"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MsgWithdrawPaymentResponse = exports.MsgWithdrawPayment = exports.MsgUpdateCollectionStateResponse = exports.MsgUpdateCollectionState = exports.MsgUpdateCollectionPaymentsResponse = exports.MsgUpdateCollectionPayments = exports.MsgUpdateCollectionIntentsResponse = exports.MsgUpdateCollectionIntents = exports.MsgUpdateCollectionDatesResponse = exports.MsgUpdateCollectionDates = exports.MsgSubmitClaimResponse = exports.MsgSubmitClaim = exports.MsgEvaluateClaimResponse = exports.MsgEvaluateClaim = exports.MsgDisputeClaimResponse = exports.MsgDisputeClaim = exports.MsgCreateCollectionResponse = exports.MsgCreateCollection = exports.MsgCreateClaimAuthorizationResponse = exports.MsgCreateClaimAuthorization = exports.MsgClaimIntentResponse = exports.MsgClaimIntent = void 0;
var _timestamp = require("../../../google/protobuf/timestamp");
var _claims = require("./claims");
var _coin = require("../../../cosmos/base/v1beta1/coin");
var _bank = require("../../../cosmos/bank/v1beta1/bank");
var _authz = require("./authz");
var _duration = require("../../../google/protobuf/duration");
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
/**
 * Agent laying dispute must be admin for Collection, or controller on
 * Collection entity, or have authz cap, aka is agent
 */

/**
 * Agent laying dispute must be admin for Collection, or controller on
 * Collection entity, or have authz cap, aka is agent
 */

/** MsgClaimIntentResponse defines the response after submitting an intent. */

/** MsgClaimIntentResponse defines the response after submitting an intent. */

/**
 * MsgCreateClaimAuthorization defines a message for creating a claim
 * authorization on behalf of an entity admin account (SubmitClaimAuthorization
 * or EvaluateClaimAuthorization)
 */

/**
 * MsgCreateClaimAuthorization defines a message for creating a claim
 * authorization on behalf of an entity admin account (SubmitClaimAuthorization
 * or EvaluateClaimAuthorization)
 */

/**
 * MsgCreateClaimAuthorizationResponse defines the response for creating a claim
 * authorization
 */

/**
 * MsgCreateClaimAuthorizationResponse defines the response for creating a claim
 * authorization
 */

function createBaseMsgCreateCollection() {
  return {
    entity: "",
    signer: "",
    protocol: "",
    startDate: undefined,
    endDate: undefined,
    quota: _helpers.Long.UZERO,
    state: 0,
    payments: undefined,
    intents: 0
  };
}
var MsgCreateCollection = exports.MsgCreateCollection = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.entity !== "") {
      writer.uint32(10).string(message.entity);
    }
    if (message.signer !== "") {
      writer.uint32(18).string(message.signer);
    }
    if (message.protocol !== "") {
      writer.uint32(26).string(message.protocol);
    }
    if (message.startDate !== undefined) {
      _timestamp.Timestamp.encode(message.startDate, writer.uint32(34).fork()).ldelim();
    }
    if (message.endDate !== undefined) {
      _timestamp.Timestamp.encode(message.endDate, writer.uint32(42).fork()).ldelim();
    }
    if (!message.quota.isZero()) {
      writer.uint32(48).uint64(message.quota);
    }
    if (message.state !== 0) {
      writer.uint32(56).int32(message.state);
    }
    if (message.payments !== undefined) {
      _claims.Payments.encode(message.payments, writer.uint32(66).fork()).ldelim();
    }
    if (message.intents !== 0) {
      writer.uint32(72).int32(message.intents);
    }
    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 = createBaseMsgCreateCollection();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.entity = reader.string();
          break;
        case 2:
          message.signer = reader.string();
          break;
        case 3:
          message.protocol = reader.string();
          break;
        case 4:
          message.startDate = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 5:
          message.endDate = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 6:
          message.quota = reader.uint64();
          break;
        case 7:
          message.state = reader.int32();
          break;
        case 8:
          message.payments = _claims.Payments.decode(reader, reader.uint32());
          break;
        case 9:
          message.intents = reader.int32();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      entity: (0, _helpers.isSet)(object.entity) ? String(object.entity) : "",
      signer: (0, _helpers.isSet)(object.signer) ? String(object.signer) : "",
      protocol: (0, _helpers.isSet)(object.protocol) ? String(object.protocol) : "",
      startDate: (0, _helpers.isSet)(object.startDate) ? (0, _helpers.fromJsonTimestamp)(object.startDate) : undefined,
      endDate: (0, _helpers.isSet)(object.endDate) ? (0, _helpers.fromJsonTimestamp)(object.endDate) : undefined,
      quota: (0, _helpers.isSet)(object.quota) ? _helpers.Long.fromValue(object.quota) : _helpers.Long.UZERO,
      state: (0, _helpers.isSet)(object.state) ? (0, _claims.collectionStateFromJSON)(object.state) : 0,
      payments: (0, _helpers.isSet)(object.payments) ? _claims.Payments.fromJSON(object.payments) : undefined,
      intents: (0, _helpers.isSet)(object.intents) ? (0, _claims.collectionIntentOptionsFromJSON)(object.intents) : 0
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.entity !== undefined && (obj.entity = message.entity);
    message.signer !== undefined && (obj.signer = message.signer);
    message.protocol !== undefined && (obj.protocol = message.protocol);
    message.startDate !== undefined && (obj.startDate = (0, _helpers.fromTimestamp)(message.startDate).toISOString());
    message.endDate !== undefined && (obj.endDate = (0, _helpers.fromTimestamp)(message.endDate).toISOString());
    message.quota !== undefined && (obj.quota = (message.quota || _helpers.Long.UZERO).toString());
    message.state !== undefined && (obj.state = (0, _claims.collectionStateToJSON)(message.state));
    message.payments !== undefined && (obj.payments = message.payments ? _claims.Payments.toJSON(message.payments) : undefined);
    message.intents !== undefined && (obj.intents = (0, _claims.collectionIntentOptionsToJSON)(message.intents));
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$entity, _object$signer, _object$protocol, _object$state, _object$intents;
    var message = createBaseMsgCreateCollection();
    message.entity = (_object$entity = object.entity) !== null && _object$entity !== void 0 ? _object$entity : "";
    message.signer = (_object$signer = object.signer) !== null && _object$signer !== void 0 ? _object$signer : "";
    message.protocol = (_object$protocol = object.protocol) !== null && _object$protocol !== void 0 ? _object$protocol : "";
    message.startDate = object.startDate !== undefined && object.startDate !== null ? _timestamp.Timestamp.fromPartial(object.startDate) : undefined;
    message.endDate = object.endDate !== undefined && object.endDate !== null ? _timestamp.Timestamp.fromPartial(object.endDate) : undefined;
    message.quota = object.quota !== undefined && object.quota !== null ? _helpers.Long.fromValue(object.quota) : _helpers.Long.UZERO;
    message.state = (_object$state = object.state) !== null && _object$state !== void 0 ? _object$state : 0;
    message.payments = object.payments !== undefined && object.payments !== null ? _claims.Payments.fromPartial(object.payments) : undefined;
    message.intents = (_object$intents = object.intents) !== null && _object$intents !== void 0 ? _object$intents : 0;
    return message;
  }
};
function createBaseMsgCreateCollectionResponse() {
  return {};
}
var MsgCreateCollectionResponse = exports.MsgCreateCollectionResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgCreateCollectionResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgCreateCollectionResponse();
    return message;
  }
};
function createBaseMsgSubmitClaim() {
  return {
    collectionId: "",
    claimId: "",
    agentDid: "",
    agentAddress: "",
    adminAddress: "",
    useIntent: false,
    amount: [],
    cw20Payment: [],
    cw1155Payment: []
  };
}
var MsgSubmitClaim = exports.MsgSubmitClaim = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.collectionId !== "") {
      writer.uint32(10).string(message.collectionId);
    }
    if (message.claimId !== "") {
      writer.uint32(18).string(message.claimId);
    }
    if (message.agentDid !== "") {
      writer.uint32(26).string(message.agentDid);
    }
    if (message.agentAddress !== "") {
      writer.uint32(34).string(message.agentAddress);
    }
    if (message.adminAddress !== "") {
      writer.uint32(42).string(message.adminAddress);
    }
    if (message.useIntent === true) {
      writer.uint32(48).bool(message.useIntent);
    }
    var _iterator = _createForOfIteratorHelper(message.amount),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        _coin.Coin.encode(v, writer.uint32(58).fork()).ldelim();
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    var _iterator2 = _createForOfIteratorHelper(message.cw20Payment),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var _v = _step2.value;
        _claims.CW20Payment.encode(_v, writer.uint32(66).fork()).ldelim();
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
    var _iterator3 = _createForOfIteratorHelper(message.cw1155Payment),
      _step3;
    try {
      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
        var _v2 = _step3.value;
        _claims.CW1155Payment.encode(_v2, writer.uint32(74).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 = createBaseMsgSubmitClaim();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.collectionId = reader.string();
          break;
        case 2:
          message.claimId = reader.string();
          break;
        case 3:
          message.agentDid = reader.string();
          break;
        case 4:
          message.agentAddress = reader.string();
          break;
        case 5:
          message.adminAddress = reader.string();
          break;
        case 6:
          message.useIntent = reader.bool();
          break;
        case 7:
          message.amount.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        case 8:
          message.cw20Payment.push(_claims.CW20Payment.decode(reader, reader.uint32()));
          break;
        case 9:
          message.cw1155Payment.push(_claims.CW1155Payment.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      collectionId: (0, _helpers.isSet)(object.collectionId) ? String(object.collectionId) : "",
      claimId: (0, _helpers.isSet)(object.claimId) ? String(object.claimId) : "",
      agentDid: (0, _helpers.isSet)(object.agentDid) ? String(object.agentDid) : "",
      agentAddress: (0, _helpers.isSet)(object.agentAddress) ? String(object.agentAddress) : "",
      adminAddress: (0, _helpers.isSet)(object.adminAddress) ? String(object.adminAddress) : "",
      useIntent: (0, _helpers.isSet)(object.useIntent) ? Boolean(object.useIntent) : false,
      amount: Array.isArray(object === null || object === void 0 ? void 0 : object.amount) ? object.amount.map(function (e) {
        return _coin.Coin.fromJSON(e);
      }) : [],
      cw20Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.cw20Payment) ? object.cw20Payment.map(function (e) {
        return _claims.CW20Payment.fromJSON(e);
      }) : [],
      cw1155Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.cw1155Payment) ? object.cw1155Payment.map(function (e) {
        return _claims.CW1155Payment.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.collectionId !== undefined && (obj.collectionId = message.collectionId);
    message.claimId !== undefined && (obj.claimId = message.claimId);
    message.agentDid !== undefined && (obj.agentDid = message.agentDid);
    message.agentAddress !== undefined && (obj.agentAddress = message.agentAddress);
    message.adminAddress !== undefined && (obj.adminAddress = message.adminAddress);
    message.useIntent !== undefined && (obj.useIntent = message.useIntent);
    if (message.amount) {
      obj.amount = message.amount.map(function (e) {
        return e ? _coin.Coin.toJSON(e) : undefined;
      });
    } else {
      obj.amount = [];
    }
    if (message.cw20Payment) {
      obj.cw20Payment = message.cw20Payment.map(function (e) {
        return e ? _claims.CW20Payment.toJSON(e) : undefined;
      });
    } else {
      obj.cw20Payment = [];
    }
    if (message.cw1155Payment) {
      obj.cw1155Payment = message.cw1155Payment.map(function (e) {
        return e ? _claims.CW1155Payment.toJSON(e) : undefined;
      });
    } else {
      obj.cw1155Payment = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$collectionId, _object$claimId, _object$agentDid, _object$agentAddress, _object$adminAddress, _object$useIntent, _object$amount, _object$cw20Payment, _object$cw1155Payment;
    var message = createBaseMsgSubmitClaim();
    message.collectionId = (_object$collectionId = object.collectionId) !== null && _object$collectionId !== void 0 ? _object$collectionId : "";
    message.claimId = (_object$claimId = object.claimId) !== null && _object$claimId !== void 0 ? _object$claimId : "";
    message.agentDid = (_object$agentDid = object.agentDid) !== null && _object$agentDid !== void 0 ? _object$agentDid : "";
    message.agentAddress = (_object$agentAddress = object.agentAddress) !== null && _object$agentAddress !== void 0 ? _object$agentAddress : "";
    message.adminAddress = (_object$adminAddress = object.adminAddress) !== null && _object$adminAddress !== void 0 ? _object$adminAddress : "";
    message.useIntent = (_object$useIntent = object.useIntent) !== null && _object$useIntent !== void 0 ? _object$useIntent : false;
    message.amount = ((_object$amount = object.amount) === null || _object$amount === void 0 ? void 0 : _object$amount.map(function (e) {
      return _coin.Coin.fromPartial(e);
    })) || [];
    message.cw20Payment = ((_object$cw20Payment = object.cw20Payment) === null || _object$cw20Payment === void 0 ? void 0 : _object$cw20Payment.map(function (e) {
      return _claims.CW20Payment.fromPartial(e);
    })) || [];
    message.cw1155Payment = ((_object$cw1155Payment = object.cw1155Payment) === null || _object$cw1155Payment === void 0 ? void 0 : _object$cw1155Payment.map(function (e) {
      return _claims.CW1155Payment.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseMsgSubmitClaimResponse() {
  return {};
}
var MsgSubmitClaimResponse = exports.MsgSubmitClaimResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgSubmitClaimResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgSubmitClaimResponse();
    return message;
  }
};
function createBaseMsgEvaluateClaim() {
  return {
    claimId: "",
    collectionId: "",
    oracle: "",
    agentDid: "",
    agentAddress: "",
    adminAddress: "",
    status: 0,
    reason: 0,
    verificationProof: "",
    amount: [],
    cw20Payment: [],
    cw1155Payment: []
  };
}
var MsgEvaluateClaim = exports.MsgEvaluateClaim = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.claimId !== "") {
      writer.uint32(10).string(message.claimId);
    }
    if (message.collectionId !== "") {
      writer.uint32(18).string(message.collectionId);
    }
    if (message.oracle !== "") {
      writer.uint32(26).string(message.oracle);
    }
    if (message.agentDid !== "") {
      writer.uint32(34).string(message.agentDid);
    }
    if (message.agentAddress !== "") {
      writer.uint32(42).string(message.agentAddress);
    }
    if (message.adminAddress !== "") {
      writer.uint32(50).string(message.adminAddress);
    }
    if (message.status !== 0) {
      writer.uint32(56).int32(message.status);
    }
    if (message.reason !== 0) {
      writer.uint32(64).uint32(message.reason);
    }
    if (message.verificationProof !== "") {
      writer.uint32(74).string(message.verificationProof);
    }
    var _iterator4 = _createForOfIteratorHelper(message.amount),
      _step4;
    try {
      for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
        var v = _step4.value;
        _coin.Coin.encode(v, writer.uint32(82).fork()).ldelim();
      }
    } catch (err) {
      _iterator4.e(err);
    } finally {
      _iterator4.f();
    }
    var _iterator5 = _createForOfIteratorHelper(message.cw20Payment),
      _step5;
    try {
      for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
        var _v3 = _step5.value;
        _claims.CW20Payment.encode(_v3, writer.uint32(90).fork()).ldelim();
      }
    } catch (err) {
      _iterator5.e(err);
    } finally {
      _iterator5.f();
    }
    var _iterator6 = _createForOfIteratorHelper(message.cw1155Payment),
      _step6;
    try {
      for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
        var _v4 = _step6.value;
        _claims.CW1155Payment.encode(_v4, writer.uint32(98).fork()).ldelim();
      }
    } catch (err) {
      _iterator6.e(err);
    } finally {
      _iterator6.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 = createBaseMsgEvaluateClaim();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.claimId = reader.string();
          break;
        case 2:
          message.collectionId = reader.string();
          break;
        case 3:
          message.oracle = reader.string();
          break;
        case 4:
          message.agentDid = reader.string();
          break;
        case 5:
          message.agentAddress = reader.string();
          break;
        case 6:
          message.adminAddress = reader.string();
          break;
        case 7:
          message.status = reader.int32();
          break;
        case 8:
          message.reason = reader.uint32();
          break;
        case 9:
          message.verificationProof = reader.string();
          break;
        case 10:
          message.amount.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        case 11:
          message.cw20Payment.push(_claims.CW20Payment.decode(reader, reader.uint32()));
          break;
        case 12:
          message.cw1155Payment.push(_claims.CW1155Payment.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      claimId: (0, _helpers.isSet)(object.claimId) ? String(object.claimId) : "",
      collectionId: (0, _helpers.isSet)(object.collectionId) ? String(object.collectionId) : "",
      oracle: (0, _helpers.isSet)(object.oracle) ? String(object.oracle) : "",
      agentDid: (0, _helpers.isSet)(object.agentDid) ? String(object.agentDid) : "",
      agentAddress: (0, _helpers.isSet)(object.agentAddress) ? String(object.agentAddress) : "",
      adminAddress: (0, _helpers.isSet)(object.adminAddress) ? String(object.adminAddress) : "",
      status: (0, _helpers.isSet)(object.status) ? (0, _claims.evaluationStatusFromJSON)(object.status) : 0,
      reason: (0, _helpers.isSet)(object.reason) ? Number(object.reason) : 0,
      verificationProof: (0, _helpers.isSet)(object.verificationProof) ? String(object.verificationProof) : "",
      amount: Array.isArray(object === null || object === void 0 ? void 0 : object.amount) ? object.amount.map(function (e) {
        return _coin.Coin.fromJSON(e);
      }) : [],
      cw20Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.cw20Payment) ? object.cw20Payment.map(function (e) {
        return _claims.CW20Payment.fromJSON(e);
      }) : [],
      cw1155Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.cw1155Payment) ? object.cw1155Payment.map(function (e) {
        return _claims.CW1155Payment.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.claimId !== undefined && (obj.claimId = message.claimId);
    message.collectionId !== undefined && (obj.collectionId = message.collectionId);
    message.oracle !== undefined && (obj.oracle = message.oracle);
    message.agentDid !== undefined && (obj.agentDid = message.agentDid);
    message.agentAddress !== undefined && (obj.agentAddress = message.agentAddress);
    message.adminAddress !== undefined && (obj.adminAddress = message.adminAddress);
    message.status !== undefined && (obj.status = (0, _claims.evaluationStatusToJSON)(message.status));
    message.reason !== undefined && (obj.reason = Math.round(message.reason));
    message.verificationProof !== undefined && (obj.verificationProof = message.verificationProof);
    if (message.amount) {
      obj.amount = message.amount.map(function (e) {
        return e ? _coin.Coin.toJSON(e) : undefined;
      });
    } else {
      obj.amount = [];
    }
    if (message.cw20Payment) {
      obj.cw20Payment = message.cw20Payment.map(function (e) {
        return e ? _claims.CW20Payment.toJSON(e) : undefined;
      });
    } else {
      obj.cw20Payment = [];
    }
    if (message.cw1155Payment) {
      obj.cw1155Payment = message.cw1155Payment.map(function (e) {
        return e ? _claims.CW1155Payment.toJSON(e) : undefined;
      });
    } else {
      obj.cw1155Payment = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$claimId2, _object$collectionId2, _object$oracle, _object$agentDid2, _object$agentAddress2, _object$adminAddress2, _object$status, _object$reason, _object$verificationP, _object$amount2, _object$cw20Payment2, _object$cw1155Payment2;
    var message = createBaseMsgEvaluateClaim();
    message.claimId = (_object$claimId2 = object.claimId) !== null && _object$claimId2 !== void 0 ? _object$claimId2 : "";
    message.collectionId = (_object$collectionId2 = object.collectionId) !== null && _object$collectionId2 !== void 0 ? _object$collectionId2 : "";
    message.oracle = (_object$oracle = object.oracle) !== null && _object$oracle !== void 0 ? _object$oracle : "";
    message.agentDid = (_object$agentDid2 = object.agentDid) !== null && _object$agentDid2 !== void 0 ? _object$agentDid2 : "";
    message.agentAddress = (_object$agentAddress2 = object.agentAddress) !== null && _object$agentAddress2 !== void 0 ? _object$agentAddress2 : "";
    message.adminAddress = (_object$adminAddress2 = object.adminAddress) !== null && _object$adminAddress2 !== void 0 ? _object$adminAddress2 : "";
    message.status = (_object$status = object.status) !== null && _object$status !== void 0 ? _object$status : 0;
    message.reason = (_object$reason = object.reason) !== null && _object$reason !== void 0 ? _object$reason : 0;
    message.verificationProof = (_object$verificationP = object.verificationProof) !== null && _object$verificationP !== void 0 ? _object$verificationP : "";
    message.amount = ((_object$amount2 = object.amount) === null || _object$amount2 === void 0 ? void 0 : _object$amount2.map(function (e) {
      return _coin.Coin.fromPartial(e);
    })) || [];
    message.cw20Payment = ((_object$cw20Payment2 = object.cw20Payment) === null || _object$cw20Payment2 === void 0 ? void 0 : _object$cw20Payment2.map(function (e) {
      return _claims.CW20Payment.fromPartial(e);
    })) || [];
    message.cw1155Payment = ((_object$cw1155Payment2 = object.cw1155Payment) === null || _object$cw1155Payment2 === void 0 ? void 0 : _object$cw1155Payment2.map(function (e) {
      return _claims.CW1155Payment.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseMsgEvaluateClaimResponse() {
  return {};
}
var MsgEvaluateClaimResponse = exports.MsgEvaluateClaimResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgEvaluateClaimResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgEvaluateClaimResponse();
    return message;
  }
};
function createBaseMsgDisputeClaim() {
  return {
    subjectId: "",
    agentDid: "",
    agentAddress: "",
    disputeType: 0,
    data: undefined
  };
}
var MsgDisputeClaim = exports.MsgDisputeClaim = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.subjectId !== "") {
      writer.uint32(10).string(message.subjectId);
    }
    if (message.agentDid !== "") {
      writer.uint32(18).string(message.agentDid);
    }
    if (message.agentAddress !== "") {
      writer.uint32(26).string(message.agentAddress);
    }
    if (message.disputeType !== 0) {
      writer.uint32(32).int32(message.disputeType);
    }
    if (message.data !== undefined) {
      _claims.DisputeData.encode(message.data, writer.uint32(42).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 = createBaseMsgDisputeClaim();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.subjectId = reader.string();
          break;
        case 2:
          message.agentDid = reader.string();
          break;
        case 3:
          message.agentAddress = reader.string();
          break;
        case 4:
          message.disputeType = reader.int32();
          break;
        case 5:
          message.data = _claims.DisputeData.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      subjectId: (0, _helpers.isSet)(object.subjectId) ? String(object.subjectId) : "",
      agentDid: (0, _helpers.isSet)(object.agentDid) ? String(object.agentDid) : "",
      agentAddress: (0, _helpers.isSet)(object.agentAddress) ? String(object.agentAddress) : "",
      disputeType: (0, _helpers.isSet)(object.disputeType) ? Number(object.disputeType) : 0,
      data: (0, _helpers.isSet)(object.data) ? _claims.DisputeData.fromJSON(object.data) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.subjectId !== undefined && (obj.subjectId = message.subjectId);
    message.agentDid !== undefined && (obj.agentDid = message.agentDid);
    message.agentAddress !== undefined && (obj.agentAddress = message.agentAddress);
    message.disputeType !== undefined && (obj.disputeType = Math.round(message.disputeType));
    message.data !== undefined && (obj.data = message.data ? _claims.DisputeData.toJSON(message.data) : undefined);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$subjectId, _object$agentDid3, _object$agentAddress3, _object$disputeType;
    var message = createBaseMsgDisputeClaim();
    message.subjectId = (_object$subjectId = object.subjectId) !== null && _object$subjectId !== void 0 ? _object$subjectId : "";
    message.agentDid = (_object$agentDid3 = object.agentDid) !== null && _object$agentDid3 !== void 0 ? _object$agentDid3 : "";
    message.agentAddress = (_object$agentAddress3 = object.agentAddress) !== null && _object$agentAddress3 !== void 0 ? _object$agentAddress3 : "";
    message.disputeType = (_object$disputeType = object.disputeType) !== null && _object$disputeType !== void 0 ? _object$disputeType : 0;
    message.data = object.data !== undefined && object.data !== null ? _claims.DisputeData.fromPartial(object.data) : undefined;
    return message;
  }
};
function createBaseMsgDisputeClaimResponse() {
  return {};
}
var MsgDisputeClaimResponse = exports.MsgDisputeClaimResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgDisputeClaimResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgDisputeClaimResponse();
    return message;
  }
};
function createBaseMsgWithdrawPayment() {
  return {
    claimId: "",
    inputs: [],
    outputs: [],
    paymentType: 0,
    contract_1155Payment: undefined,
    toAddress: "",
    fromAddress: "",
    releaseDate: undefined,
    adminAddress: "",
    cw20Payment: [],
    cw1155Payment: []
  };
}
var MsgWithdrawPayment = exports.MsgWithdrawPayment = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.claimId !== "") {
      writer.uint32(10).string(message.claimId);
    }
    var _iterator7 = _createForOfIteratorHelper(message.inputs),
      _step7;
    try {
      for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
        var v = _step7.value;
        _bank.Input.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator7.e(err);
    } finally {
      _iterator7.f();
    }
    var _iterator8 = _createForOfIteratorHelper(message.outputs),
      _step8;
    try {
      for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
        var _v5 = _step8.value;
        _bank.Output.encode(_v5, writer.uint32(26).fork()).ldelim();
      }
    } catch (err) {
      _iterator8.e(err);
    } finally {
      _iterator8.f();
    }
    if (message.paymentType !== 0) {
      writer.uint32(32).int32(message.paymentType);
    }
    if (message.contract_1155Payment !== undefined) {
      _claims.Contract1155Payment.encode(message.contract_1155Payment, writer.uint32(42).fork()).ldelim();
    }
    if (message.toAddress !== "") {
      writer.uint32(50).string(message.toAddress);
    }
    if (message.fromAddress !== "") {
      writer.uint32(58).string(message.fromAddress);
    }
    if (message.releaseDate !== undefined) {
      _timestamp.Timestamp.encode(message.releaseDate, writer.uint32(66).fork()).ldelim();
    }
    if (message.adminAddress !== "") {
      writer.uint32(74).string(message.adminAddress);
    }
    var _iterator9 = _createForOfIteratorHelper(message.cw20Payment),
      _step9;
    try {
      for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
        var _v6 = _step9.value;
        _claims.CW20Payment.encode(_v6, writer.uint32(82).fork()).ldelim();
      }
    } catch (err) {
      _iterator9.e(err);
    } finally {
      _iterator9.f();
    }
    var _iterator0 = _createForOfIteratorHelper(message.cw1155Payment),
      _step0;
    try {
      for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
        var _v7 = _step0.value;
        _claims.CW1155Payment.encode(_v7, writer.uint32(90).fork()).ldelim();
      }
    } catch (err) {
      _iterator0.e(err);
    } finally {
      _iterator0.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 = createBaseMsgWithdrawPayment();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.claimId = reader.string();
          break;
        case 2:
          message.inputs.push(_bank.Input.decode(reader, reader.uint32()));
          break;
        case 3:
          message.outputs.push(_bank.Output.decode(reader, reader.uint32()));
          break;
        case 4:
          message.paymentType = reader.int32();
          break;
        case 5:
          message.contract_1155Payment = _claims.Contract1155Payment.decode(reader, reader.uint32());
          break;
        case 6:
          message.toAddress = reader.string();
          break;
        case 7:
          message.fromAddress = reader.string();
          break;
        case 8:
          message.releaseDate = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 9:
          message.adminAddress = reader.string();
          break;
        case 10:
          message.cw20Payment.push(_claims.CW20Payment.decode(reader, reader.uint32()));
          break;
        case 11:
          message.cw1155Payment.push(_claims.CW1155Payment.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      claimId: (0, _helpers.isSet)(object.claimId) ? String(object.claimId) : "",
      inputs: Array.isArray(object === null || object === void 0 ? void 0 : object.inputs) ? object.inputs.map(function (e) {
        return _bank.Input.fromJSON(e);
      }) : [],
      outputs: Array.isArray(object === null || object === void 0 ? void 0 : object.outputs) ? object.outputs.map(function (e) {
        return _bank.Output.fromJSON(e);
      }) : [],
      paymentType: (0, _helpers.isSet)(object.paymentType) ? (0, _claims.paymentTypeFromJSON)(object.paymentType) : 0,
      contract_1155Payment: (0, _helpers.isSet)(object.contract_1155Payment) ? _claims.Contract1155Payment.fromJSON(object.contract_1155Payment) : undefined,
      toAddress: (0, _helpers.isSet)(object.toAddress) ? String(object.toAddress) : "",
      fromAddress: (0, _helpers.isSet)(object.fromAddress) ? String(object.fromAddress) : "",
      releaseDate: (0, _helpers.isSet)(object.releaseDate) ? (0, _helpers.fromJsonTimestamp)(object.releaseDate) : undefined,
      adminAddress: (0, _helpers.isSet)(object.adminAddress) ? String(object.adminAddress) : "",
      cw20Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.cw20Payment) ? object.cw20Payment.map(function (e) {
        return _claims.CW20Payment.fromJSON(e);
      }) : [],
      cw1155Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.cw1155Payment) ? object.cw1155Payment.map(function (e) {
        return _claims.CW1155Payment.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.claimId !== undefined && (obj.claimId = message.claimId);
    if (message.inputs) {
      obj.inputs = message.inputs.map(function (e) {
        return e ? _bank.Input.toJSON(e) : undefined;
      });
    } else {
      obj.inputs = [];
    }
    if (message.outputs) {
      obj.outputs = message.outputs.map(function (e) {
        return e ? _bank.Output.toJSON(e) : undefined;
      });
    } else {
      obj.outputs = [];
    }
    message.paymentType !== undefined && (obj.paymentType = (0, _claims.paymentTypeToJSON)(message.paymentType));
    message.contract_1155Payment !== undefined && (obj.contract_1155Payment = message.contract_1155Payment ? _claims.Contract1155Payment.toJSON(message.contract_1155Payment) : undefined);
    message.toAddress !== undefined && (obj.toAddress = message.toAddress);
    message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress);
    message.releaseDate !== undefined && (obj.releaseDate = (0, _helpers.fromTimestamp)(message.releaseDate).toISOString());
    message.adminAddress !== undefined && (obj.adminAddress = message.adminAddress);
    if (message.cw20Payment) {
      obj.cw20Payment = message.cw20Payment.map(function (e) {
        return e ? _claims.CW20Payment.toJSON(e) : undefined;
      });
    } else {
      obj.cw20Payment = [];
    }
    if (message.cw1155Payment) {
      obj.cw1155Payment = message.cw1155Payment.map(function (e) {
        return e ? _claims.CW1155Payment.toJSON(e) : undefined;
      });
    } else {
      obj.cw1155Payment = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$claimId3, _object$inputs, _object$outputs, _object$paymentType, _object$toAddress, _object$fromAddress, _object$adminAddress3, _object$cw20Payment3, _object$cw1155Payment3;
    var message = createBaseMsgWithdrawPayment();
    message.claimId = (_object$claimId3 = object.claimId) !== null && _object$claimId3 !== void 0 ? _object$claimId3 : "";
    message.inputs = ((_object$inputs = object.inputs) === null || _object$inputs === void 0 ? void 0 : _object$inputs.map(function (e) {
      return _bank.Input.fromPartial(e);
    })) || [];
    message.outputs = ((_object$outputs = object.outputs) === null || _object$outputs === void 0 ? void 0 : _object$outputs.map(function (e) {
      return _bank.Output.fromPartial(e);
    })) || [];
    message.paymentType = (_object$paymentType = object.paymentType) !== null && _object$paymentType !== void 0 ? _object$paymentType : 0;
    message.contract_1155Payment = object.contract_1155Payment !== undefined && object.contract_1155Payment !== null ? _claims.Contract1155Payment.fromPartial(object.contract_1155Payment) : undefined;
    message.toAddress = (_object$toAddress = object.toAddress) !== null && _object$toAddress !== void 0 ? _object$toAddress : "";
    message.fromAddress = (_object$fromAddress = object.fromAddress) !== null && _object$fromAddress !== void 0 ? _object$fromAddress : "";
    message.releaseDate = object.releaseDate !== undefined && object.releaseDate !== null ? _timestamp.Timestamp.fromPartial(object.releaseDate) : undefined;
    message.adminAddress = (_object$adminAddress3 = object.adminAddress) !== null && _object$adminAddress3 !== void 0 ? _object$adminAddress3 : "";
    message.cw20Payment = ((_object$cw20Payment3 = object.cw20Payment) === null || _object$cw20Payment3 === void 0 ? void 0 : _object$cw20Payment3.map(function (e) {
      return _claims.CW20Payment.fromPartial(e);
    })) || [];
    message.cw1155Payment = ((_object$cw1155Payment3 = object.cw1155Payment) === null || _object$cw1155Payment3 === void 0 ? void 0 : _object$cw1155Payment3.map(function (e) {
      return _claims.CW1155Payment.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseMsgWithdrawPaymentResponse() {
  return {};
}
var MsgWithdrawPaymentResponse = exports.MsgWithdrawPaymentResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgWithdrawPaymentResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgWithdrawPaymentResponse();
    return message;
  }
};
function createBaseMsgUpdateCollectionState() {
  return {
    collectionId: "",
    state: 0,
    adminAddress: ""
  };
}
var MsgUpdateCollectionState = exports.MsgUpdateCollectionState = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.collectionId !== "") {
      writer.uint32(10).string(message.collectionId);
    }
    if (message.state !== 0) {
      writer.uint32(16).int32(message.state);
    }
    if (message.adminAddress !== "") {
      writer.uint32(26).string(message.adminAddress);
    }
    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 = createBaseMsgUpdateCollectionState();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.collectionId = reader.string();
          break;
        case 2:
          message.state = reader.int32();
          break;
        case 3:
          message.adminAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      collectionId: (0, _helpers.isSet)(object.collectionId) ? String(object.collectionId) : "",
      state: (0, _helpers.isSet)(object.state) ? (0, _claims.collectionStateFromJSON)(object.state) : 0,
      adminAddress: (0, _helpers.isSet)(object.adminAddress) ? String(object.adminAddress) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.collectionId !== undefined && (obj.collectionId = message.collectionId);
    message.state !== undefined && (obj.state = (0, _claims.collectionStateToJSON)(message.state));
    message.adminAddress !== undefined && (obj.adminAddress = message.adminAddress);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$collectionId3, _object$state2, _object$adminAddress4;
    var message = createBaseMsgUpdateCollectionState();
    message.collectionId = (_object$collectionId3 = object.collectionId) !== null && _object$collectionId3 !== void 0 ? _object$collectionId3 : "";
    message.state = (_object$state2 = object.state) !== null && _object$state2 !== void 0 ? _object$state2 : 0;
    message.adminAddress = (_object$adminAddress4 = object.adminAddress) !== null && _object$adminAddress4 !== void 0 ? _object$adminAddress4 : "";
    return message;
  }
};
function createBaseMsgUpdateCollectionStateResponse() {
  return {};
}
var MsgUpdateCollectionStateResponse = exports.MsgUpdateCollectionStateResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgUpdateCollectionStateResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgUpdateCollectionStateResponse();
    return message;
  }
};
function createBaseMsgUpdateCollectionDates() {
  return {
    collectionId: "",
    startDate: undefined,
    endDate: undefined,
    adminAddress: ""
  };
}
var MsgUpdateCollectionDates = exports.MsgUpdateCollectionDates = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.collectionId !== "") {
      writer.uint32(10).string(message.collectionId);
    }
    if (message.startDate !== undefined) {
      _timestamp.Timestamp.encode(message.startDate, writer.uint32(18).fork()).ldelim();
    }
    if (message.endDate !== undefined) {
      _timestamp.Timestamp.encode(message.endDate, writer.uint32(26).fork()).ldelim();
    }
    if (message.adminAddress !== "") {
      writer.uint32(34).string(message.adminAddress);
    }
    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 = createBaseMsgUpdateCollectionDates();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.collectionId = reader.string();
          break;
        case 2:
          message.startDate = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 3:
          message.endDate = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 4:
          message.adminAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      collectionId: (0, _helpers.isSet)(object.collectionId) ? String(object.collectionId) : "",
      startDate: (0, _helpers.isSet)(object.startDate) ? (0, _helpers.fromJsonTimestamp)(object.startDate) : undefined,
      endDate: (0, _helpers.isSet)(object.endDate) ? (0, _helpers.fromJsonTimestamp)(object.endDate) : undefined,
      adminAddress: (0, _helpers.isSet)(object.adminAddress) ? String(object.adminAddress) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.collectionId !== undefined && (obj.collectionId = message.collectionId);
    message.startDate !== undefined && (obj.startDate = (0, _helpers.fromTimestamp)(message.startDate).toISOString());
    message.endDate !== undefined && (obj.endDate = (0, _helpers.fromTimestamp)(message.endDate).toISOString());
    message.adminAddress !== undefined && (obj.adminAddress = message.adminAddress);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$collectionId4, _object$adminAddress5;
    var message = createBaseMsgUpdateCollectionDates();
    message.collectionId = (_object$collectionId4 = object.collectionId) !== null && _object$collectionId4 !== void 0 ? _object$collectionId4 : "";
    message.startDate = object.startDate !== undefined && object.startDate !== null ? _timestamp.Timestamp.fromPartial(object.startDate) : undefined;
    message.endDate = object.endDate !== undefined && object.endDate !== null ? _timestamp.Timestamp.fromPartial(object.endDate) : undefined;
    message.adminAddress = (_object$adminAddress5 = object.adminAddress) !== null && _object$adminAddress5 !== void 0 ? _object$adminAddress5 : "";
    return message;
  }
};
function createBaseMsgUpdateCollectionDatesResponse() {
  return {};
}
var MsgUpdateCollectionDatesResponse = exports.MsgUpdateCollectionDatesResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgUpdateCollectionDatesResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgUpdateCollectionDatesResponse();
    return message;
  }
};
function createBaseMsgUpdateCollectionPayments() {
  return {
    collectionId: "",
    payments: undefined,
    adminAddress: ""
  };
}
var MsgUpdateCollectionPayments = exports.MsgUpdateCollectionPayments = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.collectionId !== "") {
      writer.uint32(10).string(message.collectionId);
    }
    if (message.payments !== undefined) {
      _claims.Payments.encode(message.payments, writer.uint32(18).fork()).ldelim();
    }
    if (message.adminAddress !== "") {
      writer.uint32(26).string(message.adminAddress);
    }
    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 = createBaseMsgUpdateCollectionPayments();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.collectionId = reader.string();
          break;
        case 2:
          message.payments = _claims.Payments.decode(reader, reader.uint32());
          break;
        case 3:
          message.adminAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      collectionId: (0, _helpers.isSet)(object.collectionId) ? String(object.collectionId) : "",
      payments: (0, _helpers.isSet)(object.payments) ? _claims.Payments.fromJSON(object.payments) : undefined,
      adminAddress: (0, _helpers.isSet)(object.adminAddress) ? String(object.adminAddress) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.collectionId !== undefined && (obj.collectionId = message.collectionId);
    message.payments !== undefined && (obj.payments = message.payments ? _claims.Payments.toJSON(message.payments) : undefined);
    message.adminAddress !== undefined && (obj.adminAddress = message.adminAddress);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$collectionId5, _object$adminAddress6;
    var message = createBaseMsgUpdateCollectionPayments();
    message.collectionId = (_object$collectionId5 = object.collectionId) !== null && _object$collectionId5 !== void 0 ? _object$collectionId5 : "";
    message.payments = object.payments !== undefined && object.payments !== null ? _claims.Payments.fromPartial(object.payments) : undefined;
    message.adminAddress = (_object$adminAddress6 = object.adminAddress) !== null && _object$adminAddress6 !== void 0 ? _object$adminAddress6 : "";
    return message;
  }
};
function createBaseMsgUpdateCollectionPaymentsResponse() {
  return {};
}
var MsgUpdateCollectionPaymentsResponse = exports.MsgUpdateCollectionPaymentsResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgUpdateCollectionPaymentsResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgUpdateCollectionPaymentsResponse();
    return message;
  }
};
function createBaseMsgUpdateCollectionIntents() {
  return {
    collectionId: "",
    intents: 0,
    adminAddress: ""
  };
}
var MsgUpdateCollectionIntents = exports.MsgUpdateCollectionIntents = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.collectionId !== "") {
      writer.uint32(10).string(message.collectionId);
    }
    if (message.intents !== 0) {
      writer.uint32(16).int32(message.intents);
    }
    if (message.adminAddress !== "") {
      writer.uint32(26).string(message.adminAddress);
    }
    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 = createBaseMsgUpdateCollectionIntents();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.collectionId = reader.string();
          break;
        case 2:
          message.intents = reader.int32();
          break;
        case 3:
          message.adminAddress = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      collectionId: (0, _helpers.isSet)(object.collectionId) ? String(object.collectionId) : "",
      intents: (0, _helpers.isSet)(object.intents) ? (0, _claims.collectionIntentOptionsFromJSON)(object.intents) : 0,
      adminAddress: (0, _helpers.isSet)(object.adminAddress) ? String(object.adminAddress) : ""
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.collectionId !== undefined && (obj.collectionId = message.collectionId);
    message.intents !== undefined && (obj.intents = (0, _claims.collectionIntentOptionsToJSON)(message.intents));
    message.adminAddress !== undefined && (obj.adminAddress = message.adminAddress);
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$collectionId6, _object$intents2, _object$adminAddress7;
    var message = createBaseMsgUpdateCollectionIntents();
    message.collectionId = (_object$collectionId6 = object.collectionId) !== null && _object$collectionId6 !== void 0 ? _object$collectionId6 : "";
    message.intents = (_object$intents2 = object.intents) !== null && _object$intents2 !== void 0 ? _object$intents2 : 0;
    message.adminAddress = (_object$adminAddress7 = object.adminAddress) !== null && _object$adminAddress7 !== void 0 ? _object$adminAddress7 : "";
    return message;
  }
};
function createBaseMsgUpdateCollectionIntentsResponse() {
  return {};
}
var MsgUpdateCollectionIntentsResponse = exports.MsgUpdateCollectionIntentsResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgUpdateCollectionIntentsResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgUpdateCollectionIntentsResponse();
    return message;
  }
};
function createBaseMsgClaimIntent() {
  return {
    agentDid: "",
    agentAddress: "",
    collectionId: "",
    amount: [],
    cw20Payment: [],
    cw1155Payment: []
  };
}
var MsgClaimIntent = exports.MsgClaimIntent = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.agentDid !== "") {
      writer.uint32(10).string(message.agentDid);
    }
    if (message.agentAddress !== "") {
      writer.uint32(18).string(message.agentAddress);
    }
    if (message.collectionId !== "") {
      writer.uint32(26).string(message.collectionId);
    }
    var _iterator1 = _createForOfIteratorHelper(message.amount),
      _step1;
    try {
      for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
        var v = _step1.value;
        _coin.Coin.encode(v, writer.uint32(34).fork()).ldelim();
      }
    } catch (err) {
      _iterator1.e(err);
    } finally {
      _iterator1.f();
    }
    var _iterator10 = _createForOfIteratorHelper(message.cw20Payment),
      _step10;
    try {
      for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
        var _v8 = _step10.value;
        _claims.CW20Payment.encode(_v8, writer.uint32(42).fork()).ldelim();
      }
    } catch (err) {
      _iterator10.e(err);
    } finally {
      _iterator10.f();
    }
    var _iterator11 = _createForOfIteratorHelper(message.cw1155Payment),
      _step11;
    try {
      for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
        var _v9 = _step11.value;
        _claims.CW1155Payment.encode(_v9, writer.uint32(50).fork()).ldelim();
      }
    } catch (err) {
      _iterator11.e(err);
    } finally {
      _iterator11.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 = createBaseMsgClaimIntent();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.agentDid = reader.string();
          break;
        case 2:
          message.agentAddress = reader.string();
          break;
        case 3:
          message.collectionId = reader.string();
          break;
        case 4:
          message.amount.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        case 5:
          message.cw20Payment.push(_claims.CW20Payment.decode(reader, reader.uint32()));
          break;
        case 6:
          message.cw1155Payment.push(_claims.CW1155Payment.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      agentDid: (0, _helpers.isSet)(object.agentDid) ? String(object.agentDid) : "",
      agentAddress: (0, _helpers.isSet)(object.agentAddress) ? String(object.agentAddress) : "",
      collectionId: (0, _helpers.isSet)(object.collectionId) ? String(object.collectionId) : "",
      amount: Array.isArray(object === null || object === void 0 ? void 0 : object.amount) ? object.amount.map(function (e) {
        return _coin.Coin.fromJSON(e);
      }) : [],
      cw20Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.cw20Payment) ? object.cw20Payment.map(function (e) {
        return _claims.CW20Payment.fromJSON(e);
      }) : [],
      cw1155Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.cw1155Payment) ? object.cw1155Payment.map(function (e) {
        return _claims.CW1155Payment.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.agentDid !== undefined && (obj.agentDid = message.agentDid);
    message.agentAddress !== undefined && (obj.agentAddress = message.agentAddress);
    message.collectionId !== undefined && (obj.collectionId = message.collectionId);
    if (message.amount) {
      obj.amount = message.amount.map(function (e) {
        return e ? _coin.Coin.toJSON(e) : undefined;
      });
    } else {
      obj.amount = [];
    }
    if (message.cw20Payment) {
      obj.cw20Payment = message.cw20Payment.map(function (e) {
        return e ? _claims.CW20Payment.toJSON(e) : undefined;
      });
    } else {
      obj.cw20Payment = [];
    }
    if (message.cw1155Payment) {
      obj.cw1155Payment = message.cw1155Payment.map(function (e) {
        return e ? _claims.CW1155Payment.toJSON(e) : undefined;
      });
    } else {
      obj.cw1155Payment = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$agentDid4, _object$agentAddress4, _object$collectionId7, _object$amount3, _object$cw20Payment4, _object$cw1155Payment4;
    var message = createBaseMsgClaimIntent();
    message.agentDid = (_object$agentDid4 = object.agentDid) !== null && _object$agentDid4 !== void 0 ? _object$agentDid4 : "";
    message.agentAddress = (_object$agentAddress4 = object.agentAddress) !== null && _object$agentAddress4 !== void 0 ? _object$agentAddress4 : "";
    message.collectionId = (_object$collectionId7 = object.collectionId) !== null && _object$collectionId7 !== void 0 ? _object$collectionId7 : "";
    message.amount = ((_object$amount3 = object.amount) === null || _object$amount3 === void 0 ? void 0 : _object$amount3.map(function (e) {
      return _coin.Coin.fromPartial(e);
    })) || [];
    message.cw20Payment = ((_object$cw20Payment4 = object.cw20Payment) === null || _object$cw20Payment4 === void 0 ? void 0 : _object$cw20Payment4.map(function (e) {
      return _claims.CW20Payment.fromPartial(e);
    })) || [];
    message.cw1155Payment = ((_object$cw1155Payment4 = object.cw1155Payment) === null || _object$cw1155Payment4 === void 0 ? void 0 : _object$cw1155Payment4.map(function (e) {
      return _claims.CW1155Payment.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseMsgClaimIntentResponse() {
  return {
    intentId: "",
    expireAt: undefined
  };
}
var MsgClaimIntentResponse = exports.MsgClaimIntentResponse = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.intentId !== "") {
      writer.uint32(10).string(message.intentId);
    }
    if (message.expireAt !== undefined) {
      _timestamp.Timestamp.encode(message.expireAt, 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 = createBaseMsgClaimIntentResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.intentId = reader.string();
          break;
        case 2:
          message.expireAt = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      intentId: (0, _helpers.isSet)(object.intentId) ? String(object.intentId) : "",
      expireAt: (0, _helpers.isSet)(object.expireAt) ? (0, _helpers.fromJsonTimestamp)(object.expireAt) : undefined
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.intentId !== undefined && (obj.intentId = message.intentId);
    message.expireAt !== undefined && (obj.expireAt = (0, _helpers.fromTimestamp)(message.expireAt).toISOString());
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$intentId;
    var message = createBaseMsgClaimIntentResponse();
    message.intentId = (_object$intentId = object.intentId) !== null && _object$intentId !== void 0 ? _object$intentId : "";
    message.expireAt = object.expireAt !== undefined && object.expireAt !== null ? _timestamp.Timestamp.fromPartial(object.expireAt) : undefined;
    return message;
  }
};
function createBaseMsgCreateClaimAuthorization() {
  return {
    creatorAddress: "",
    creatorDid: "",
    granteeAddress: "",
    adminAddress: "",
    collectionId: "",
    authType: 0,
    agentQuota: _helpers.Long.UZERO,
    maxAmount: [],
    maxCw20Payment: [],
    expiration: undefined,
    intentDurationNs: undefined,
    beforeDate: undefined,
    maxCw1155Payment: []
  };
}
var MsgCreateClaimAuthorization = exports.MsgCreateClaimAuthorization = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.creatorAddress !== "") {
      writer.uint32(10).string(message.creatorAddress);
    }
    if (message.creatorDid !== "") {
      writer.uint32(18).string(message.creatorDid);
    }
    if (message.granteeAddress !== "") {
      writer.uint32(26).string(message.granteeAddress);
    }
    if (message.adminAddress !== "") {
      writer.uint32(34).string(message.adminAddress);
    }
    if (message.collectionId !== "") {
      writer.uint32(42).string(message.collectionId);
    }
    if (message.authType !== 0) {
      writer.uint32(48).int32(message.authType);
    }
    if (!message.agentQuota.isZero()) {
      writer.uint32(56).uint64(message.agentQuota);
    }
    var _iterator12 = _createForOfIteratorHelper(message.maxAmount),
      _step12;
    try {
      for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
        var v = _step12.value;
        _coin.Coin.encode(v, writer.uint32(66).fork()).ldelim();
      }
    } catch (err) {
      _iterator12.e(err);
    } finally {
      _iterator12.f();
    }
    var _iterator13 = _createForOfIteratorHelper(message.maxCw20Payment),
      _step13;
    try {
      for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
        var _v0 = _step13.value;
        _claims.CW20Payment.encode(_v0, writer.uint32(74).fork()).ldelim();
      }
    } catch (err) {
      _iterator13.e(err);
    } finally {
      _iterator13.f();
    }
    if (message.expiration !== undefined) {
      _timestamp.Timestamp.encode(message.expiration, writer.uint32(82).fork()).ldelim();
    }
    if (message.intentDurationNs !== undefined) {
      _duration.Duration.encode(message.intentDurationNs, writer.uint32(90).fork()).ldelim();
    }
    if (message.beforeDate !== undefined) {
      _timestamp.Timestamp.encode(message.beforeDate, writer.uint32(98).fork()).ldelim();
    }
    var _iterator14 = _createForOfIteratorHelper(message.maxCw1155Payment),
      _step14;
    try {
      for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
        var _v1 = _step14.value;
        _claims.CW1155Payment.encode(_v1, writer.uint32(106).fork()).ldelim();
      }
    } catch (err) {
      _iterator14.e(err);
    } finally {
      _iterator14.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 = createBaseMsgCreateClaimAuthorization();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.creatorAddress = reader.string();
          break;
        case 2:
          message.creatorDid = reader.string();
          break;
        case 3:
          message.granteeAddress = reader.string();
          break;
        case 4:
          message.adminAddress = reader.string();
          break;
        case 5:
          message.collectionId = reader.string();
          break;
        case 6:
          message.authType = reader.int32();
          break;
        case 7:
          message.agentQuota = reader.uint64();
          break;
        case 8:
          message.maxAmount.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        case 9:
          message.maxCw20Payment.push(_claims.CW20Payment.decode(reader, reader.uint32()));
          break;
        case 10:
          message.expiration = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 11:
          message.intentDurationNs = _duration.Duration.decode(reader, reader.uint32());
          break;
        case 12:
          message.beforeDate = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 13:
          message.maxCw1155Payment.push(_claims.CW1155Payment.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      creatorAddress: (0, _helpers.isSet)(object.creatorAddress) ? String(object.creatorAddress) : "",
      creatorDid: (0, _helpers.isSet)(object.creatorDid) ? String(object.creatorDid) : "",
      granteeAddress: (0, _helpers.isSet)(object.granteeAddress) ? String(object.granteeAddress) : "",
      adminAddress: (0, _helpers.isSet)(object.adminAddress) ? String(object.adminAddress) : "",
      collectionId: (0, _helpers.isSet)(object.collectionId) ? String(object.collectionId) : "",
      authType: (0, _helpers.isSet)(object.authType) ? (0, _authz.createClaimAuthorizationTypeFromJSON)(object.authType) : 0,
      agentQuota: (0, _helpers.isSet)(object.agentQuota) ? _helpers.Long.fromValue(object.agentQuota) : _helpers.Long.UZERO,
      maxAmount: Array.isArray(object === null || object === void 0 ? void 0 : object.maxAmount) ? object.maxAmount.map(function (e) {
        return _coin.Coin.fromJSON(e);
      }) : [],
      maxCw20Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.maxCw20Payment) ? object.maxCw20Payment.map(function (e) {
        return _claims.CW20Payment.fromJSON(e);
      }) : [],
      expiration: (0, _helpers.isSet)(object.expiration) ? (0, _helpers.fromJsonTimestamp)(object.expiration) : undefined,
      intentDurationNs: (0, _helpers.isSet)(object.intentDurationNs) ? _duration.Duration.fromJSON(object.intentDurationNs) : undefined,
      beforeDate: (0, _helpers.isSet)(object.beforeDate) ? (0, _helpers.fromJsonTimestamp)(object.beforeDate) : undefined,
      maxCw1155Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.maxCw1155Payment) ? object.maxCw1155Payment.map(function (e) {
        return _claims.CW1155Payment.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.creatorAddress !== undefined && (obj.creatorAddress = message.creatorAddress);
    message.creatorDid !== undefined && (obj.creatorDid = message.creatorDid);
    message.granteeAddress !== undefined && (obj.granteeAddress = message.granteeAddress);
    message.adminAddress !== undefined && (obj.adminAddress = message.adminAddress);
    message.collectionId !== undefined && (obj.collectionId = message.collectionId);
    message.authType !== undefined && (obj.authType = (0, _authz.createClaimAuthorizationTypeToJSON)(message.authType));
    message.agentQuota !== undefined && (obj.agentQuota = (message.agentQuota || _helpers.Long.UZERO).toString());
    if (message.maxAmount) {
      obj.maxAmount = message.maxAmount.map(function (e) {
        return e ? _coin.Coin.toJSON(e) : undefined;
      });
    } else {
      obj.maxAmount = [];
    }
    if (message.maxCw20Payment) {
      obj.maxCw20Payment = message.maxCw20Payment.map(function (e) {
        return e ? _claims.CW20Payment.toJSON(e) : undefined;
      });
    } else {
      obj.maxCw20Payment = [];
    }
    message.expiration !== undefined && (obj.expiration = (0, _helpers.fromTimestamp)(message.expiration).toISOString());
    message.intentDurationNs !== undefined && (obj.intentDurationNs = message.intentDurationNs ? _duration.Duration.toJSON(message.intentDurationNs) : undefined);
    message.beforeDate !== undefined && (obj.beforeDate = (0, _helpers.fromTimestamp)(message.beforeDate).toISOString());
    if (message.maxCw1155Payment) {
      obj.maxCw1155Payment = message.maxCw1155Payment.map(function (e) {
        return e ? _claims.CW1155Payment.toJSON(e) : undefined;
      });
    } else {
      obj.maxCw1155Payment = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$creatorAddres, _object$creatorDid, _object$granteeAddres, _object$adminAddress8, _object$collectionId8, _object$authType, _object$maxAmount, _object$maxCw20Paymen, _object$maxCw1155Paym;
    var message = createBaseMsgCreateClaimAuthorization();
    message.creatorAddress = (_object$creatorAddres = object.creatorAddress) !== null && _object$creatorAddres !== void 0 ? _object$creatorAddres : "";
    message.creatorDid = (_object$creatorDid = object.creatorDid) !== null && _object$creatorDid !== void 0 ? _object$creatorDid : "";
    message.granteeAddress = (_object$granteeAddres = object.granteeAddress) !== null && _object$granteeAddres !== void 0 ? _object$granteeAddres : "";
    message.adminAddress = (_object$adminAddress8 = object.adminAddress) !== null && _object$adminAddress8 !== void 0 ? _object$adminAddress8 : "";
    message.collectionId = (_object$collectionId8 = object.collectionId) !== null && _object$collectionId8 !== void 0 ? _object$collectionId8 : "";
    message.authType = (_object$authType = object.authType) !== null && _object$authType !== void 0 ? _object$authType : 0;
    message.agentQuota = object.agentQuota !== undefined && object.agentQuota !== null ? _helpers.Long.fromValue(object.agentQuota) : _helpers.Long.UZERO;
    message.maxAmount = ((_object$maxAmount = object.maxAmount) === null || _object$maxAmount === void 0 ? void 0 : _object$maxAmount.map(function (e) {
      return _coin.Coin.fromPartial(e);
    })) || [];
    message.maxCw20Payment = ((_object$maxCw20Paymen = object.maxCw20Payment) === null || _object$maxCw20Paymen === void 0 ? void 0 : _object$maxCw20Paymen.map(function (e) {
      return _claims.CW20Payment.fromPartial(e);
    })) || [];
    message.expiration = object.expiration !== undefined && object.expiration !== null ? _timestamp.Timestamp.fromPartial(object.expiration) : undefined;
    message.intentDurationNs = object.intentDurationNs !== undefined && object.intentDurationNs !== null ? _duration.Duration.fromPartial(object.intentDurationNs) : undefined;
    message.beforeDate = object.beforeDate !== undefined && object.beforeDate !== null ? _timestamp.Timestamp.fromPartial(object.beforeDate) : undefined;
    message.maxCw1155Payment = ((_object$maxCw1155Paym = object.maxCw1155Payment) === null || _object$maxCw1155Paym === void 0 ? void 0 : _object$maxCw1155Paym.map(function (e) {
      return _claims.CW1155Payment.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseMsgCreateClaimAuthorizationResponse() {
  return {};
}
var MsgCreateClaimAuthorizationResponse = exports.MsgCreateClaimAuthorizationResponse = {
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    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 = createBaseMsgCreateClaimAuthorizationResponse();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  toJSON: function toJSON(_) {
    var obj = {};
    return obj;
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgCreateClaimAuthorizationResponse();
    return message;
  }
};