"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.QueryTotalTimeoutFeesResponse = exports.QueryTotalTimeoutFeesRequest = exports.QueryTotalRecvFeesResponse = exports.QueryTotalRecvFeesRequest = exports.QueryTotalAckFeesResponse = exports.QueryTotalAckFeesRequest = exports.QueryPayeeResponse = exports.QueryPayeeRequest = exports.QueryIncentivizedPacketsResponse = exports.QueryIncentivizedPacketsRequest = exports.QueryIncentivizedPacketsForChannelResponse = exports.QueryIncentivizedPacketsForChannelRequest = exports.QueryIncentivizedPacketResponse = exports.QueryIncentivizedPacketRequest = exports.QueryFeeEnabledChannelsResponse = exports.QueryFeeEnabledChannelsRequest = exports.QueryFeeEnabledChannelResponse = exports.QueryFeeEnabledChannelRequest = exports.QueryCounterpartyPayeeResponse = exports.QueryCounterpartyPayeeRequest = void 0;
var _pagination = require("../../../../cosmos/base/query/v1beta1/pagination");
var _channel = require("../../../core/channel/v1/channel");
var _fee = require("./fee");
var _coin = require("../../../../cosmos/base/v1beta1/coin");
var _genesis = require("./genesis");
var _helpers = require("../../../../helpers");
var _m0 = _interopRequireWildcard(require("protobufjs/minimal"));
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } //@ts-nocheck
/** QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc */

/** QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc */

/** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc */

/** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc */

/** QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc */

/** QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc */

/** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc */

/** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc */

/**
 * QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets
 * for a specific channel
 */

/**
 * QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets
 * for a specific channel
 */

/** QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC */

/** QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC */

/** QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc */

/** QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc */

/** QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc */

/** QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc */

/** QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc */

/** QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc */

/** QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc */

/** QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc */

/** QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc */

/** QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc */

/** QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc */

/** QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc */

/** QueryPayeeRequest defines the request type for the Payee rpc */

/** QueryPayeeRequest defines the request type for the Payee rpc */

/** QueryPayeeResponse defines the response type for the Payee rpc */

/** QueryPayeeResponse defines the response type for the Payee rpc */

/** QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc */

/** QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc */

/** QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc */

/** QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc */

/** QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc */

/** QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc */

/** QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc */

/** QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc */

/** QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc */

/** QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc */

/** QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc */

/** QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc */

function createBaseQueryIncentivizedPacketsRequest() {
  return {
    pagination: undefined,
    queryHeight: _helpers.Long.UZERO
  };
}
var QueryIncentivizedPacketsRequest = exports.QueryIncentivizedPacketsRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.pagination !== undefined) {
      _pagination.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
    }
    if (!message.queryHeight.isZero()) {
      writer.uint32(16).uint64(message.queryHeight);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryIncentivizedPacketsRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.pagination = _pagination.PageRequest.decode(reader, reader.uint32());
          break;
        case 2:
          message.queryHeight = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      pagination: (0, _helpers.isSet)(object.pagination) ? _pagination.PageRequest.fromJSON(object.pagination) : undefined,
      queryHeight: (0, _helpers.isSet)(object.queryHeight) ? _helpers.Long.fromValue(object.queryHeight) : _helpers.Long.UZERO
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.pagination !== undefined && (obj.pagination = message.pagination ? _pagination.PageRequest.toJSON(message.pagination) : undefined);
    message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || _helpers.Long.UZERO).toString());
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryIncentivizedPacketsRequest();
    message.pagination = object.pagination !== undefined && object.pagination !== null ? _pagination.PageRequest.fromPartial(object.pagination) : undefined;
    message.queryHeight = object.queryHeight !== undefined && object.queryHeight !== null ? _helpers.Long.fromValue(object.queryHeight) : _helpers.Long.UZERO;
    return message;
  }
};
function createBaseQueryIncentivizedPacketsResponse() {
  return {
    incentivizedPackets: [],
    pagination: undefined
  };
}
var QueryIncentivizedPacketsResponse = exports.QueryIncentivizedPacketsResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    var _iterator = _createForOfIteratorHelper(message.incentivizedPackets),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        _fee.IdentifiedPacketFees.encode(v, writer.uint32(10).fork()).ldelim();
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    if (message.pagination !== undefined) {
      _pagination.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryIncentivizedPacketsResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.incentivizedPackets.push(_fee.IdentifiedPacketFees.decode(reader, reader.uint32()));
          break;
        case 2:
          message.pagination = _pagination.PageResponse.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      incentivizedPackets: Array.isArray(object === null || object === void 0 ? void 0 : object.incentivizedPackets) ? object.incentivizedPackets.map(function (e) {
        return _fee.IdentifiedPacketFees.fromJSON(e);
      }) : [],
      pagination: (0, _helpers.isSet)(object.pagination) ? _pagination.PageResponse.fromJSON(object.pagination) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    if (message.incentivizedPackets) {
      obj.incentivizedPackets = message.incentivizedPackets.map(function (e) {
        return e ? _fee.IdentifiedPacketFees.toJSON(e) : undefined;
      });
    } else {
      obj.incentivizedPackets = [];
    }
    message.pagination !== undefined && (obj.pagination = message.pagination ? _pagination.PageResponse.toJSON(message.pagination) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$incentivizedP;
    var message = createBaseQueryIncentivizedPacketsResponse();
    message.incentivizedPackets = ((_object$incentivizedP = object.incentivizedPackets) === null || _object$incentivizedP === void 0 ? void 0 : _object$incentivizedP.map(function (e) {
      return _fee.IdentifiedPacketFees.fromPartial(e);
    })) || [];
    message.pagination = object.pagination !== undefined && object.pagination !== null ? _pagination.PageResponse.fromPartial(object.pagination) : undefined;
    return message;
  }
};
function createBaseQueryIncentivizedPacketRequest() {
  return {
    packetId: undefined,
    queryHeight: _helpers.Long.UZERO
  };
}
var QueryIncentivizedPacketRequest = exports.QueryIncentivizedPacketRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.packetId !== undefined) {
      _channel.PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim();
    }
    if (!message.queryHeight.isZero()) {
      writer.uint32(16).uint64(message.queryHeight);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryIncentivizedPacketRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.packetId = _channel.PacketId.decode(reader, reader.uint32());
          break;
        case 2:
          message.queryHeight = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      packetId: (0, _helpers.isSet)(object.packetId) ? _channel.PacketId.fromJSON(object.packetId) : undefined,
      queryHeight: (0, _helpers.isSet)(object.queryHeight) ? _helpers.Long.fromValue(object.queryHeight) : _helpers.Long.UZERO
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.packetId !== undefined && (obj.packetId = message.packetId ? _channel.PacketId.toJSON(message.packetId) : undefined);
    message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || _helpers.Long.UZERO).toString());
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryIncentivizedPacketRequest();
    message.packetId = object.packetId !== undefined && object.packetId !== null ? _channel.PacketId.fromPartial(object.packetId) : undefined;
    message.queryHeight = object.queryHeight !== undefined && object.queryHeight !== null ? _helpers.Long.fromValue(object.queryHeight) : _helpers.Long.UZERO;
    return message;
  }
};
function createBaseQueryIncentivizedPacketResponse() {
  return {
    incentivizedPacket: undefined
  };
}
var QueryIncentivizedPacketResponse = exports.QueryIncentivizedPacketResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.incentivizedPacket !== undefined) {
      _fee.IdentifiedPacketFees.encode(message.incentivizedPacket, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryIncentivizedPacketResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.incentivizedPacket = _fee.IdentifiedPacketFees.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      incentivizedPacket: (0, _helpers.isSet)(object.incentivizedPacket) ? _fee.IdentifiedPacketFees.fromJSON(object.incentivizedPacket) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.incentivizedPacket !== undefined && (obj.incentivizedPacket = message.incentivizedPacket ? _fee.IdentifiedPacketFees.toJSON(message.incentivizedPacket) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryIncentivizedPacketResponse();
    message.incentivizedPacket = object.incentivizedPacket !== undefined && object.incentivizedPacket !== null ? _fee.IdentifiedPacketFees.fromPartial(object.incentivizedPacket) : undefined;
    return message;
  }
};
function createBaseQueryIncentivizedPacketsForChannelRequest() {
  return {
    pagination: undefined,
    portId: "",
    channelId: "",
    queryHeight: _helpers.Long.UZERO
  };
}
var QueryIncentivizedPacketsForChannelRequest = exports.QueryIncentivizedPacketsForChannelRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.pagination !== undefined) {
      _pagination.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
    }
    if (message.portId !== "") {
      writer.uint32(18).string(message.portId);
    }
    if (message.channelId !== "") {
      writer.uint32(26).string(message.channelId);
    }
    if (!message.queryHeight.isZero()) {
      writer.uint32(32).uint64(message.queryHeight);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryIncentivizedPacketsForChannelRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.pagination = _pagination.PageRequest.decode(reader, reader.uint32());
          break;
        case 2:
          message.portId = reader.string();
          break;
        case 3:
          message.channelId = reader.string();
          break;
        case 4:
          message.queryHeight = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      pagination: (0, _helpers.isSet)(object.pagination) ? _pagination.PageRequest.fromJSON(object.pagination) : undefined,
      portId: (0, _helpers.isSet)(object.portId) ? String(object.portId) : "",
      channelId: (0, _helpers.isSet)(object.channelId) ? String(object.channelId) : "",
      queryHeight: (0, _helpers.isSet)(object.queryHeight) ? _helpers.Long.fromValue(object.queryHeight) : _helpers.Long.UZERO
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.pagination !== undefined && (obj.pagination = message.pagination ? _pagination.PageRequest.toJSON(message.pagination) : undefined);
    message.portId !== undefined && (obj.portId = message.portId);
    message.channelId !== undefined && (obj.channelId = message.channelId);
    message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || _helpers.Long.UZERO).toString());
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$portId, _object$channelId;
    var message = createBaseQueryIncentivizedPacketsForChannelRequest();
    message.pagination = object.pagination !== undefined && object.pagination !== null ? _pagination.PageRequest.fromPartial(object.pagination) : undefined;
    message.portId = (_object$portId = object.portId) !== null && _object$portId !== void 0 ? _object$portId : "";
    message.channelId = (_object$channelId = object.channelId) !== null && _object$channelId !== void 0 ? _object$channelId : "";
    message.queryHeight = object.queryHeight !== undefined && object.queryHeight !== null ? _helpers.Long.fromValue(object.queryHeight) : _helpers.Long.UZERO;
    return message;
  }
};
function createBaseQueryIncentivizedPacketsForChannelResponse() {
  return {
    incentivizedPackets: [],
    pagination: undefined
  };
}
var QueryIncentivizedPacketsForChannelResponse = exports.QueryIncentivizedPacketsForChannelResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    var _iterator2 = _createForOfIteratorHelper(message.incentivizedPackets),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var v = _step2.value;
        _fee.IdentifiedPacketFees.encode(v, writer.uint32(10).fork()).ldelim();
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
    if (message.pagination !== undefined) {
      _pagination.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryIncentivizedPacketsForChannelResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.incentivizedPackets.push(_fee.IdentifiedPacketFees.decode(reader, reader.uint32()));
          break;
        case 2:
          message.pagination = _pagination.PageResponse.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      incentivizedPackets: Array.isArray(object === null || object === void 0 ? void 0 : object.incentivizedPackets) ? object.incentivizedPackets.map(function (e) {
        return _fee.IdentifiedPacketFees.fromJSON(e);
      }) : [],
      pagination: (0, _helpers.isSet)(object.pagination) ? _pagination.PageResponse.fromJSON(object.pagination) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    if (message.incentivizedPackets) {
      obj.incentivizedPackets = message.incentivizedPackets.map(function (e) {
        return e ? _fee.IdentifiedPacketFees.toJSON(e) : undefined;
      });
    } else {
      obj.incentivizedPackets = [];
    }
    message.pagination !== undefined && (obj.pagination = message.pagination ? _pagination.PageResponse.toJSON(message.pagination) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$incentivizedP2;
    var message = createBaseQueryIncentivizedPacketsForChannelResponse();
    message.incentivizedPackets = ((_object$incentivizedP2 = object.incentivizedPackets) === null || _object$incentivizedP2 === void 0 ? void 0 : _object$incentivizedP2.map(function (e) {
      return _fee.IdentifiedPacketFees.fromPartial(e);
    })) || [];
    message.pagination = object.pagination !== undefined && object.pagination !== null ? _pagination.PageResponse.fromPartial(object.pagination) : undefined;
    return message;
  }
};
function createBaseQueryTotalRecvFeesRequest() {
  return {
    packetId: undefined
  };
}
var QueryTotalRecvFeesRequest = exports.QueryTotalRecvFeesRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.packetId !== undefined) {
      _channel.PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryTotalRecvFeesRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.packetId = _channel.PacketId.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      packetId: (0, _helpers.isSet)(object.packetId) ? _channel.PacketId.fromJSON(object.packetId) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.packetId !== undefined && (obj.packetId = message.packetId ? _channel.PacketId.toJSON(message.packetId) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryTotalRecvFeesRequest();
    message.packetId = object.packetId !== undefined && object.packetId !== null ? _channel.PacketId.fromPartial(object.packetId) : undefined;
    return message;
  }
};
function createBaseQueryTotalRecvFeesResponse() {
  return {
    recvFees: []
  };
}
var QueryTotalRecvFeesResponse = exports.QueryTotalRecvFeesResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    var _iterator3 = _createForOfIteratorHelper(message.recvFees),
      _step3;
    try {
      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
        var v = _step3.value;
        _coin.Coin.encode(v, writer.uint32(10).fork()).ldelim();
      }
    } catch (err) {
      _iterator3.e(err);
    } finally {
      _iterator3.f();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryTotalRecvFeesResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.recvFees.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      recvFees: Array.isArray(object === null || object === void 0 ? void 0 : object.recvFees) ? object.recvFees.map(function (e) {
        return _coin.Coin.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    if (message.recvFees) {
      obj.recvFees = message.recvFees.map(function (e) {
        return e ? _coin.Coin.toJSON(e) : undefined;
      });
    } else {
      obj.recvFees = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$recvFees;
    var message = createBaseQueryTotalRecvFeesResponse();
    message.recvFees = ((_object$recvFees = object.recvFees) === null || _object$recvFees === void 0 ? void 0 : _object$recvFees.map(function (e) {
      return _coin.Coin.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseQueryTotalAckFeesRequest() {
  return {
    packetId: undefined
  };
}
var QueryTotalAckFeesRequest = exports.QueryTotalAckFeesRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.packetId !== undefined) {
      _channel.PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryTotalAckFeesRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.packetId = _channel.PacketId.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      packetId: (0, _helpers.isSet)(object.packetId) ? _channel.PacketId.fromJSON(object.packetId) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.packetId !== undefined && (obj.packetId = message.packetId ? _channel.PacketId.toJSON(message.packetId) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryTotalAckFeesRequest();
    message.packetId = object.packetId !== undefined && object.packetId !== null ? _channel.PacketId.fromPartial(object.packetId) : undefined;
    return message;
  }
};
function createBaseQueryTotalAckFeesResponse() {
  return {
    ackFees: []
  };
}
var QueryTotalAckFeesResponse = exports.QueryTotalAckFeesResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    var _iterator4 = _createForOfIteratorHelper(message.ackFees),
      _step4;
    try {
      for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
        var v = _step4.value;
        _coin.Coin.encode(v, writer.uint32(10).fork()).ldelim();
      }
    } catch (err) {
      _iterator4.e(err);
    } finally {
      _iterator4.f();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryTotalAckFeesResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.ackFees.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      ackFees: Array.isArray(object === null || object === void 0 ? void 0 : object.ackFees) ? object.ackFees.map(function (e) {
        return _coin.Coin.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    if (message.ackFees) {
      obj.ackFees = message.ackFees.map(function (e) {
        return e ? _coin.Coin.toJSON(e) : undefined;
      });
    } else {
      obj.ackFees = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$ackFees;
    var message = createBaseQueryTotalAckFeesResponse();
    message.ackFees = ((_object$ackFees = object.ackFees) === null || _object$ackFees === void 0 ? void 0 : _object$ackFees.map(function (e) {
      return _coin.Coin.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseQueryTotalTimeoutFeesRequest() {
  return {
    packetId: undefined
  };
}
var QueryTotalTimeoutFeesRequest = exports.QueryTotalTimeoutFeesRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.packetId !== undefined) {
      _channel.PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryTotalTimeoutFeesRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.packetId = _channel.PacketId.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      packetId: (0, _helpers.isSet)(object.packetId) ? _channel.PacketId.fromJSON(object.packetId) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.packetId !== undefined && (obj.packetId = message.packetId ? _channel.PacketId.toJSON(message.packetId) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryTotalTimeoutFeesRequest();
    message.packetId = object.packetId !== undefined && object.packetId !== null ? _channel.PacketId.fromPartial(object.packetId) : undefined;
    return message;
  }
};
function createBaseQueryTotalTimeoutFeesResponse() {
  return {
    timeoutFees: []
  };
}
var QueryTotalTimeoutFeesResponse = exports.QueryTotalTimeoutFeesResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    var _iterator5 = _createForOfIteratorHelper(message.timeoutFees),
      _step5;
    try {
      for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
        var v = _step5.value;
        _coin.Coin.encode(v, writer.uint32(10).fork()).ldelim();
      }
    } catch (err) {
      _iterator5.e(err);
    } finally {
      _iterator5.f();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryTotalTimeoutFeesResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.timeoutFees.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      timeoutFees: Array.isArray(object === null || object === void 0 ? void 0 : object.timeoutFees) ? object.timeoutFees.map(function (e) {
        return _coin.Coin.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    if (message.timeoutFees) {
      obj.timeoutFees = message.timeoutFees.map(function (e) {
        return e ? _coin.Coin.toJSON(e) : undefined;
      });
    } else {
      obj.timeoutFees = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$timeoutFees;
    var message = createBaseQueryTotalTimeoutFeesResponse();
    message.timeoutFees = ((_object$timeoutFees = object.timeoutFees) === null || _object$timeoutFees === void 0 ? void 0 : _object$timeoutFees.map(function (e) {
      return _coin.Coin.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseQueryPayeeRequest() {
  return {
    channelId: "",
    relayer: ""
  };
}
var QueryPayeeRequest = exports.QueryPayeeRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.channelId !== "") {
      writer.uint32(10).string(message.channelId);
    }
    if (message.relayer !== "") {
      writer.uint32(18).string(message.relayer);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryPayeeRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.channelId = reader.string();
          break;
        case 2:
          message.relayer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      channelId: (0, _helpers.isSet)(object.channelId) ? String(object.channelId) : "",
      relayer: (0, _helpers.isSet)(object.relayer) ? String(object.relayer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.channelId !== undefined && (obj.channelId = message.channelId);
    message.relayer !== undefined && (obj.relayer = message.relayer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$channelId2, _object$relayer;
    var message = createBaseQueryPayeeRequest();
    message.channelId = (_object$channelId2 = object.channelId) !== null && _object$channelId2 !== void 0 ? _object$channelId2 : "";
    message.relayer = (_object$relayer = object.relayer) !== null && _object$relayer !== void 0 ? _object$relayer : "";
    return message;
  }
};
function createBaseQueryPayeeResponse() {
  return {
    payeeAddress: ""
  };
}
var QueryPayeeResponse = exports.QueryPayeeResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.payeeAddress !== "") {
      writer.uint32(10).string(message.payeeAddress);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryPayeeResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.payeeAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      payeeAddress: (0, _helpers.isSet)(object.payeeAddress) ? String(object.payeeAddress) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.payeeAddress !== undefined && (obj.payeeAddress = message.payeeAddress);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$payeeAddress;
    var message = createBaseQueryPayeeResponse();
    message.payeeAddress = (_object$payeeAddress = object.payeeAddress) !== null && _object$payeeAddress !== void 0 ? _object$payeeAddress : "";
    return message;
  }
};
function createBaseQueryCounterpartyPayeeRequest() {
  return {
    channelId: "",
    relayer: ""
  };
}
var QueryCounterpartyPayeeRequest = exports.QueryCounterpartyPayeeRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.channelId !== "") {
      writer.uint32(10).string(message.channelId);
    }
    if (message.relayer !== "") {
      writer.uint32(18).string(message.relayer);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryCounterpartyPayeeRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.channelId = reader.string();
          break;
        case 2:
          message.relayer = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      channelId: (0, _helpers.isSet)(object.channelId) ? String(object.channelId) : "",
      relayer: (0, _helpers.isSet)(object.relayer) ? String(object.relayer) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.channelId !== undefined && (obj.channelId = message.channelId);
    message.relayer !== undefined && (obj.relayer = message.relayer);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$channelId3, _object$relayer2;
    var message = createBaseQueryCounterpartyPayeeRequest();
    message.channelId = (_object$channelId3 = object.channelId) !== null && _object$channelId3 !== void 0 ? _object$channelId3 : "";
    message.relayer = (_object$relayer2 = object.relayer) !== null && _object$relayer2 !== void 0 ? _object$relayer2 : "";
    return message;
  }
};
function createBaseQueryCounterpartyPayeeResponse() {
  return {
    counterpartyPayee: ""
  };
}
var QueryCounterpartyPayeeResponse = exports.QueryCounterpartyPayeeResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.counterpartyPayee !== "") {
      writer.uint32(10).string(message.counterpartyPayee);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryCounterpartyPayeeResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.counterpartyPayee = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      counterpartyPayee: (0, _helpers.isSet)(object.counterpartyPayee) ? String(object.counterpartyPayee) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.counterpartyPayee !== undefined && (obj.counterpartyPayee = message.counterpartyPayee);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$counterpartyP;
    var message = createBaseQueryCounterpartyPayeeResponse();
    message.counterpartyPayee = (_object$counterpartyP = object.counterpartyPayee) !== null && _object$counterpartyP !== void 0 ? _object$counterpartyP : "";
    return message;
  }
};
function createBaseQueryFeeEnabledChannelsRequest() {
  return {
    pagination: undefined,
    queryHeight: _helpers.Long.UZERO
  };
}
var QueryFeeEnabledChannelsRequest = exports.QueryFeeEnabledChannelsRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.pagination !== undefined) {
      _pagination.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
    }
    if (!message.queryHeight.isZero()) {
      writer.uint32(16).uint64(message.queryHeight);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryFeeEnabledChannelsRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.pagination = _pagination.PageRequest.decode(reader, reader.uint32());
          break;
        case 2:
          message.queryHeight = reader.uint64();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      pagination: (0, _helpers.isSet)(object.pagination) ? _pagination.PageRequest.fromJSON(object.pagination) : undefined,
      queryHeight: (0, _helpers.isSet)(object.queryHeight) ? _helpers.Long.fromValue(object.queryHeight) : _helpers.Long.UZERO
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.pagination !== undefined && (obj.pagination = message.pagination ? _pagination.PageRequest.toJSON(message.pagination) : undefined);
    message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || _helpers.Long.UZERO).toString());
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseQueryFeeEnabledChannelsRequest();
    message.pagination = object.pagination !== undefined && object.pagination !== null ? _pagination.PageRequest.fromPartial(object.pagination) : undefined;
    message.queryHeight = object.queryHeight !== undefined && object.queryHeight !== null ? _helpers.Long.fromValue(object.queryHeight) : _helpers.Long.UZERO;
    return message;
  }
};
function createBaseQueryFeeEnabledChannelsResponse() {
  return {
    feeEnabledChannels: [],
    pagination: undefined
  };
}
var QueryFeeEnabledChannelsResponse = exports.QueryFeeEnabledChannelsResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    var _iterator6 = _createForOfIteratorHelper(message.feeEnabledChannels),
      _step6;
    try {
      for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
        var v = _step6.value;
        _genesis.FeeEnabledChannel.encode(v, writer.uint32(10).fork()).ldelim();
      }
    } catch (err) {
      _iterator6.e(err);
    } finally {
      _iterator6.f();
    }
    if (message.pagination !== undefined) {
      _pagination.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryFeeEnabledChannelsResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feeEnabledChannels.push(_genesis.FeeEnabledChannel.decode(reader, reader.uint32()));
          break;
        case 2:
          message.pagination = _pagination.PageResponse.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      feeEnabledChannels: Array.isArray(object === null || object === void 0 ? void 0 : object.feeEnabledChannels) ? object.feeEnabledChannels.map(function (e) {
        return _genesis.FeeEnabledChannel.fromJSON(e);
      }) : [],
      pagination: (0, _helpers.isSet)(object.pagination) ? _pagination.PageResponse.fromJSON(object.pagination) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    if (message.feeEnabledChannels) {
      obj.feeEnabledChannels = message.feeEnabledChannels.map(function (e) {
        return e ? _genesis.FeeEnabledChannel.toJSON(e) : undefined;
      });
    } else {
      obj.feeEnabledChannels = [];
    }
    message.pagination !== undefined && (obj.pagination = message.pagination ? _pagination.PageResponse.toJSON(message.pagination) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$feeEnabledCha;
    var message = createBaseQueryFeeEnabledChannelsResponse();
    message.feeEnabledChannels = ((_object$feeEnabledCha = object.feeEnabledChannels) === null || _object$feeEnabledCha === void 0 ? void 0 : _object$feeEnabledCha.map(function (e) {
      return _genesis.FeeEnabledChannel.fromPartial(e);
    })) || [];
    message.pagination = object.pagination !== undefined && object.pagination !== null ? _pagination.PageResponse.fromPartial(object.pagination) : undefined;
    return message;
  }
};
function createBaseQueryFeeEnabledChannelRequest() {
  return {
    portId: "",
    channelId: ""
  };
}
var QueryFeeEnabledChannelRequest = exports.QueryFeeEnabledChannelRequest = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.portId !== "") {
      writer.uint32(10).string(message.portId);
    }
    if (message.channelId !== "") {
      writer.uint32(18).string(message.channelId);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryFeeEnabledChannelRequest();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.portId = reader.string();
          break;
        case 2:
          message.channelId = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      portId: (0, _helpers.isSet)(object.portId) ? String(object.portId) : "",
      channelId: (0, _helpers.isSet)(object.channelId) ? String(object.channelId) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.portId !== undefined && (obj.portId = message.portId);
    message.channelId !== undefined && (obj.channelId = message.channelId);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$portId2, _object$channelId4;
    var message = createBaseQueryFeeEnabledChannelRequest();
    message.portId = (_object$portId2 = object.portId) !== null && _object$portId2 !== void 0 ? _object$portId2 : "";
    message.channelId = (_object$channelId4 = object.channelId) !== null && _object$channelId4 !== void 0 ? _object$channelId4 : "";
    return message;
  }
};
function createBaseQueryFeeEnabledChannelResponse() {
  return {
    feeEnabled: false
  };
}
var QueryFeeEnabledChannelResponse = exports.QueryFeeEnabledChannelResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.feeEnabled === true) {
      writer.uint32(8).bool(message.feeEnabled);
    }
    return writer;
  },
  decode: function decode(input, length) {
    var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    var end = length === undefined ? reader.len : reader.pos + length;
    var message = createBaseQueryFeeEnabledChannelResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.feeEnabled = reader.bool();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      feeEnabled: (0, _helpers.isSet)(object.feeEnabled) ? Boolean(object.feeEnabled) : false
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.feeEnabled !== undefined && (obj.feeEnabled = message.feeEnabled);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$feeEnabled;
    var message = createBaseQueryFeeEnabledChannelResponse();
    message.feeEnabled = (_object$feeEnabled = object.feeEnabled) !== null && _object$feeEnabled !== void 0 ? _object$feeEnabled : false;
    return message;
  }
};