"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.QueryTasksResponse = exports.QueryTasksRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryGetRewardResponseReward = exports.QueryGetRewardResponse = exports.QueryGetRewardRequest = exports.QueryAllRewardsResponse = exports.QueryAllRewardsRequest = void 0;
var _pagination = require("../cosmos/base/query/v1beta1/pagination");
var _params = require("./params");
var _task = require("./task");
var _pool = require("./pool");
var _coin = require("../cosmos/base/v1beta1/coin");
var _rewards = require("./rewards");
var _binary = require("../binary");
var _helpers = require("../helpers");
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
/** QueryParamsRequest is the request type for the Query/Params RPC method. */

/** QueryParamsRequest is the request type for the Query/Params RPC method. */

/** QueryParamsRequest is the request type for the Query/Params RPC method. */

/** QueryParamsResponse is the response type for the Query/Params RPC method. */

/** QueryParamsResponse is the response type for the Query/Params RPC method. */

/** QueryParamsResponse is the response type for the Query/Params RPC method. */

function createBaseQueryParamsRequest() {
  return {};
}
var QueryParamsRequest = exports.QueryParamsRequest = {
  typeUrl: "/gitopia.gitopia.rewards.QueryParamsRequest",
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    return writer;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseQueryParamsRequest();
    return message;
  },
  fromAmino: function fromAmino(_) {
    var message = createBaseQueryParamsRequest();
    return message;
  },
  toAmino: function toAmino(_) {
    var obj = {};
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return QueryParamsRequest.fromAmino(object.value);
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return QueryParamsRequest.decode(message.value);
  },
  toProto: function toProto(message) {
    return QueryParamsRequest.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/gitopia.gitopia.rewards.QueryParamsRequest",
      value: QueryParamsRequest.encode(message).finish()
    };
  }
};
function createBaseQueryParamsResponse() {
  return {
    params: _params.Params.fromPartial({})
  };
}
var QueryParamsResponse = exports.QueryParamsResponse = {
  typeUrl: "/gitopia.gitopia.rewards.QueryParamsResponse",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.params !== undefined) {
      _params.Params.encode(message.params, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      params: (0, _helpers.isSet)(object.params) ? _params.Params.fromJSON(object.params) : undefined
    };
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryParamsResponse();
    message.params = object.params !== undefined && object.params !== null ? _params.Params.fromPartial(object.params) : undefined;
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseQueryParamsResponse();
    if (object.params !== undefined && object.params !== null) {
      message.params = _params.Params.fromAmino(object.params);
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.params = message.params ? _params.Params.toAmino(message.params) : undefined;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return QueryParamsResponse.fromAmino(object.value);
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return QueryParamsResponse.decode(message.value);
  },
  toProto: function toProto(message) {
    return QueryParamsResponse.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/gitopia.gitopia.rewards.QueryParamsResponse",
      value: QueryParamsResponse.encode(message).finish()
    };
  }
};
function createBaseQueryTasksRequest() {
  return {
    address: ""
  };
}
var QueryTasksRequest = exports.QueryTasksRequest = {
  typeUrl: "/gitopia.gitopia.rewards.QueryTasksRequest",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.address !== "") {
      writer.uint32(10).string(message.address);
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      address: (0, _helpers.isSet)(object.address) ? String(object.address) : ""
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$address;
    var message = createBaseQueryTasksRequest();
    message.address = (_object$address = object.address) !== null && _object$address !== void 0 ? _object$address : "";
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseQueryTasksRequest();
    if (object.address !== undefined && object.address !== null) {
      message.address = object.address;
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.address = message.address === "" ? undefined : message.address;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return QueryTasksRequest.fromAmino(object.value);
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return QueryTasksRequest.decode(message.value);
  },
  toProto: function toProto(message) {
    return QueryTasksRequest.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/gitopia.gitopia.rewards.QueryTasksRequest",
      value: QueryTasksRequest.encode(message).finish()
    };
  }
};
function createBaseQueryTasksResponse() {
  return {
    tasks: []
  };
}
var QueryTasksResponse = exports.QueryTasksResponse = {
  typeUrl: "/gitopia.gitopia.rewards.QueryTasksResponse",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    var _iterator = _createForOfIteratorHelper(message.tasks),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        _task.Task.encode(v, writer.uint32(10).fork()).ldelim();
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      tasks: Array.isArray(object === null || object === void 0 ? void 0 : object.tasks) ? object.tasks.map(function (e) {
        return _task.Task.fromJSON(e);
      }) : []
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$tasks;
    var message = createBaseQueryTasksResponse();
    message.tasks = ((_object$tasks = object.tasks) === null || _object$tasks === void 0 ? void 0 : _object$tasks.map(function (e) {
      return _task.Task.fromPartial(e);
    })) || [];
    return message;
  },
  fromAmino: function fromAmino(object) {
    var _object$tasks2;
    var message = createBaseQueryTasksResponse();
    message.tasks = ((_object$tasks2 = object.tasks) === null || _object$tasks2 === void 0 ? void 0 : _object$tasks2.map(function (e) {
      return _task.Task.fromAmino(e);
    })) || [];
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    if (message.tasks) {
      obj.tasks = message.tasks.map(function (e) {
        return e ? _task.Task.toAmino(e) : undefined;
      });
    } else {
      obj.tasks = message.tasks;
    }
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return QueryTasksResponse.fromAmino(object.value);
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return QueryTasksResponse.decode(message.value);
  },
  toProto: function toProto(message) {
    return QueryTasksResponse.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/gitopia.gitopia.rewards.QueryTasksResponse",
      value: QueryTasksResponse.encode(message).finish()
    };
  }
};
function createBaseQueryGetRewardRequest() {
  return {
    recipient: ""
  };
}
var QueryGetRewardRequest = exports.QueryGetRewardRequest = {
  typeUrl: "/gitopia.gitopia.rewards.QueryGetRewardRequest",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.recipient !== "") {
      writer.uint32(10).string(message.recipient);
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      recipient: (0, _helpers.isSet)(object.recipient) ? String(object.recipient) : ""
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$recipient;
    var message = createBaseQueryGetRewardRequest();
    message.recipient = (_object$recipient = object.recipient) !== null && _object$recipient !== void 0 ? _object$recipient : "";
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseQueryGetRewardRequest();
    if (object.recipient !== undefined && object.recipient !== null) {
      message.recipient = object.recipient;
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.recipient = message.recipient === "" ? undefined : message.recipient;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return QueryGetRewardRequest.fromAmino(object.value);
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return QueryGetRewardRequest.decode(message.value);
  },
  toProto: function toProto(message) {
    return QueryGetRewardRequest.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/gitopia.gitopia.rewards.QueryGetRewardRequest",
      value: QueryGetRewardRequest.encode(message).finish()
    };
  }
};
function createBaseQueryGetRewardResponseReward() {
  return {
    creator: "",
    series: 0,
    amount: _coin.Coin.fromPartial({}),
    claimedAmount: _coin.Coin.fromPartial({}),
    claimableAmount: _coin.Coin.fromPartial({}),
    remainingClaimableAmount: _coin.Coin.fromPartial({})
  };
}
var QueryGetRewardResponseReward = exports.QueryGetRewardResponseReward = {
  typeUrl: "/gitopia.gitopia.rewards.QueryGetRewardResponseReward",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.creator !== "") {
      writer.uint32(10).string(message.creator);
    }
    if (message.series !== 0) {
      writer.uint32(16).int32(message.series);
    }
    if (message.amount !== undefined) {
      _coin.Coin.encode(message.amount, writer.uint32(26).fork()).ldelim();
    }
    if (message.claimedAmount !== undefined) {
      _coin.Coin.encode(message.claimedAmount, writer.uint32(34).fork()).ldelim();
    }
    if (message.claimableAmount !== undefined) {
      _coin.Coin.encode(message.claimableAmount, writer.uint32(42).fork()).ldelim();
    }
    if (message.remainingClaimableAmount !== undefined) {
      _coin.Coin.encode(message.remainingClaimableAmount, writer.uint32(50).fork()).ldelim();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      creator: (0, _helpers.isSet)(object.creator) ? String(object.creator) : "",
      series: (0, _helpers.isSet)(object.series) ? (0, _pool.seriesFromJSON)(object.series) : -1,
      amount: (0, _helpers.isSet)(object.amount) ? _coin.Coin.fromJSON(object.amount) : undefined,
      claimedAmount: (0, _helpers.isSet)(object.claimedAmount) ? _coin.Coin.fromJSON(object.claimedAmount) : undefined,
      claimableAmount: (0, _helpers.isSet)(object.claimableAmount) ? _coin.Coin.fromJSON(object.claimableAmount) : undefined,
      remainingClaimableAmount: (0, _helpers.isSet)(object.remainingClaimableAmount) ? _coin.Coin.fromJSON(object.remainingClaimableAmount) : undefined
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$creator, _object$series;
    var message = createBaseQueryGetRewardResponseReward();
    message.creator = (_object$creator = object.creator) !== null && _object$creator !== void 0 ? _object$creator : "";
    message.series = (_object$series = object.series) !== null && _object$series !== void 0 ? _object$series : 0;
    message.amount = object.amount !== undefined && object.amount !== null ? _coin.Coin.fromPartial(object.amount) : undefined;
    message.claimedAmount = object.claimedAmount !== undefined && object.claimedAmount !== null ? _coin.Coin.fromPartial(object.claimedAmount) : undefined;
    message.claimableAmount = object.claimableAmount !== undefined && object.claimableAmount !== null ? _coin.Coin.fromPartial(object.claimableAmount) : undefined;
    message.remainingClaimableAmount = object.remainingClaimableAmount !== undefined && object.remainingClaimableAmount !== null ? _coin.Coin.fromPartial(object.remainingClaimableAmount) : undefined;
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseQueryGetRewardResponseReward();
    if (object.creator !== undefined && object.creator !== null) {
      message.creator = object.creator;
    }
    if (object.series !== undefined && object.series !== null) {
      message.series = object.series;
    }
    if (object.amount !== undefined && object.amount !== null) {
      message.amount = _coin.Coin.fromAmino(object.amount);
    }
    if (object.claimed_amount !== undefined && object.claimed_amount !== null) {
      message.claimedAmount = _coin.Coin.fromAmino(object.claimed_amount);
    }
    if (object.claimable_amount !== undefined && object.claimable_amount !== null) {
      message.claimableAmount = _coin.Coin.fromAmino(object.claimable_amount);
    }
    if (object.remaining_claimable_amount !== undefined && object.remaining_claimable_amount !== null) {
      message.remainingClaimableAmount = _coin.Coin.fromAmino(object.remaining_claimable_amount);
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.creator = message.creator === "" ? undefined : message.creator;
    obj.series = message.series === 0 ? undefined : message.series;
    obj.amount = message.amount ? _coin.Coin.toAmino(message.amount) : undefined;
    obj.claimed_amount = message.claimedAmount ? _coin.Coin.toAmino(message.claimedAmount) : undefined;
    obj.claimable_amount = message.claimableAmount ? _coin.Coin.toAmino(message.claimableAmount) : undefined;
    obj.remaining_claimable_amount = message.remainingClaimableAmount ? _coin.Coin.toAmino(message.remainingClaimableAmount) : undefined;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return QueryGetRewardResponseReward.fromAmino(object.value);
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return QueryGetRewardResponseReward.decode(message.value);
  },
  toProto: function toProto(message) {
    return QueryGetRewardResponseReward.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/gitopia.gitopia.rewards.QueryGetRewardResponseReward",
      value: QueryGetRewardResponseReward.encode(message).finish()
    };
  }
};
function createBaseQueryGetRewardResponse() {
  return {
    recipient: "",
    rewards: []
  };
}
var QueryGetRewardResponse = exports.QueryGetRewardResponse = {
  typeUrl: "/gitopia.gitopia.rewards.QueryGetRewardResponse",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.recipient !== "") {
      writer.uint32(10).string(message.recipient);
    }
    var _iterator2 = _createForOfIteratorHelper(message.rewards),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var v = _step2.value;
        QueryGetRewardResponseReward.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      recipient: (0, _helpers.isSet)(object.recipient) ? String(object.recipient) : "",
      rewards: Array.isArray(object === null || object === void 0 ? void 0 : object.rewards) ? object.rewards.map(function (e) {
        return QueryGetRewardResponseReward.fromJSON(e);
      }) : []
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$recipient2, _object$rewards;
    var message = createBaseQueryGetRewardResponse();
    message.recipient = (_object$recipient2 = object.recipient) !== null && _object$recipient2 !== void 0 ? _object$recipient2 : "";
    message.rewards = ((_object$rewards = object.rewards) === null || _object$rewards === void 0 ? void 0 : _object$rewards.map(function (e) {
      return QueryGetRewardResponseReward.fromPartial(e);
    })) || [];
    return message;
  },
  fromAmino: function fromAmino(object) {
    var _object$rewards2;
    var message = createBaseQueryGetRewardResponse();
    if (object.recipient !== undefined && object.recipient !== null) {
      message.recipient = object.recipient;
    }
    message.rewards = ((_object$rewards2 = object.rewards) === null || _object$rewards2 === void 0 ? void 0 : _object$rewards2.map(function (e) {
      return QueryGetRewardResponseReward.fromAmino(e);
    })) || [];
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.recipient = message.recipient === "" ? undefined : message.recipient;
    if (message.rewards) {
      obj.rewards = message.rewards.map(function (e) {
        return e ? QueryGetRewardResponseReward.toAmino(e) : undefined;
      });
    } else {
      obj.rewards = message.rewards;
    }
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return QueryGetRewardResponse.fromAmino(object.value);
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return QueryGetRewardResponse.decode(message.value);
  },
  toProto: function toProto(message) {
    return QueryGetRewardResponse.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/gitopia.gitopia.rewards.QueryGetRewardResponse",
      value: QueryGetRewardResponse.encode(message).finish()
    };
  }
};
function createBaseQueryAllRewardsRequest() {
  return {
    pagination: undefined
  };
}
var QueryAllRewardsRequest = exports.QueryAllRewardsRequest = {
  typeUrl: "/gitopia.gitopia.rewards.QueryAllRewardsRequest",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.pagination !== undefined) {
      _pagination.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      pagination: (0, _helpers.isSet)(object.pagination) ? _pagination.PageRequest.fromJSON(object.pagination) : undefined
    };
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryAllRewardsRequest();
    message.pagination = object.pagination !== undefined && object.pagination !== null ? _pagination.PageRequest.fromPartial(object.pagination) : undefined;
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseQueryAllRewardsRequest();
    if (object.pagination !== undefined && object.pagination !== null) {
      message.pagination = _pagination.PageRequest.fromAmino(object.pagination);
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.pagination = message.pagination ? _pagination.PageRequest.toAmino(message.pagination) : undefined;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return QueryAllRewardsRequest.fromAmino(object.value);
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return QueryAllRewardsRequest.decode(message.value);
  },
  toProto: function toProto(message) {
    return QueryAllRewardsRequest.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/gitopia.gitopia.rewards.QueryAllRewardsRequest",
      value: QueryAllRewardsRequest.encode(message).finish()
    };
  }
};
function createBaseQueryAllRewardsResponse() {
  return {
    rewards: [],
    pagination: undefined
  };
}
var QueryAllRewardsResponse = exports.QueryAllRewardsResponse = {
  typeUrl: "/gitopia.gitopia.rewards.QueryAllRewardsResponse",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    var _iterator3 = _createForOfIteratorHelper(message.rewards),
      _step3;
    try {
      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
        var v = _step3.value;
        _rewards.Reward.encode(v, writer.uint32(10).fork()).ldelim();
      }
    } catch (err) {
      _iterator3.e(err);
    } finally {
      _iterator3.f();
    }
    if (message.pagination !== undefined) {
      _pagination.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      rewards: Array.isArray(object === null || object === void 0 ? void 0 : object.rewards) ? object.rewards.map(function (e) {
        return _rewards.Reward.fromJSON(e);
      }) : [],
      pagination: (0, _helpers.isSet)(object.pagination) ? _pagination.PageResponse.fromJSON(object.pagination) : undefined
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$rewards3;
    var message = createBaseQueryAllRewardsResponse();
    message.rewards = ((_object$rewards3 = object.rewards) === null || _object$rewards3 === void 0 ? void 0 : _object$rewards3.map(function (e) {
      return _rewards.Reward.fromPartial(e);
    })) || [];
    message.pagination = object.pagination !== undefined && object.pagination !== null ? _pagination.PageResponse.fromPartial(object.pagination) : undefined;
    return message;
  },
  fromAmino: function fromAmino(object) {
    var _object$rewards4;
    var message = createBaseQueryAllRewardsResponse();
    message.rewards = ((_object$rewards4 = object.rewards) === null || _object$rewards4 === void 0 ? void 0 : _object$rewards4.map(function (e) {
      return _rewards.Reward.fromAmino(e);
    })) || [];
    if (object.pagination !== undefined && object.pagination !== null) {
      message.pagination = _pagination.PageResponse.fromAmino(object.pagination);
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    if (message.rewards) {
      obj.rewards = message.rewards.map(function (e) {
        return e ? _rewards.Reward.toAmino(e) : undefined;
      });
    } else {
      obj.rewards = message.rewards;
    }
    obj.pagination = message.pagination ? _pagination.PageResponse.toAmino(message.pagination) : undefined;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return QueryAllRewardsResponse.fromAmino(object.value);
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return QueryAllRewardsResponse.decode(message.value);
  },
  toProto: function toProto(message) {
    return QueryAllRewardsResponse.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/gitopia.gitopia.rewards.QueryAllRewardsResponse",
      value: QueryAllRewardsResponse.encode(message).finish()
    };
  }
};