"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.WithdrawPaymentConstraints = exports.WithdrawPaymentAuthorization = exports.SubmitClaimConstraints = exports.SubmitClaimAuthorization = exports.EvaluateClaimConstraints = exports.EvaluateClaimAuthorization = exports.CreateClaimAuthorizationTypeSDKType = exports.CreateClaimAuthorizationType = exports.CreateClaimAuthorizationConstraints = exports.CreateClaimAuthorizationAuthorization = void 0;
exports.createClaimAuthorizationTypeFromJSON = createClaimAuthorizationTypeFromJSON;
exports.createClaimAuthorizationTypeToJSON = createClaimAuthorizationTypeToJSON;
var _coin = require("../../../cosmos/base/v1beta1/coin");
var _claims = require("./claims");
var _duration = require("../../../google/protobuf/duration");
var _timestamp = require("../../../google/protobuf/timestamp");
var _bank = require("../../../cosmos/bank/v1beta1/bank");
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
/**
 * AuthorizationType defines the types of claim authorizations that can be
 * created
 */
var CreateClaimAuthorizationType = exports.CreateClaimAuthorizationType = /*#__PURE__*/function (CreateClaimAuthorizationType) {
  /** ALL - both submit and evaluate */
  CreateClaimAuthorizationType[CreateClaimAuthorizationType["ALL"] = 0] = "ALL";
  /** SUBMIT - submit only */
  CreateClaimAuthorizationType[CreateClaimAuthorizationType["SUBMIT"] = 1] = "SUBMIT";
  /** EVALUATE - evaluate only */
  CreateClaimAuthorizationType[CreateClaimAuthorizationType["EVALUATE"] = 2] = "EVALUATE";
  CreateClaimAuthorizationType[CreateClaimAuthorizationType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
  return CreateClaimAuthorizationType;
}({});
var CreateClaimAuthorizationTypeSDKType = exports.CreateClaimAuthorizationTypeSDKType = CreateClaimAuthorizationType;
function createClaimAuthorizationTypeFromJSON(object) {
  switch (object) {
    case 0:
    case "ALL":
      return CreateClaimAuthorizationType.ALL;
    case 1:
    case "SUBMIT":
      return CreateClaimAuthorizationType.SUBMIT;
    case 2:
    case "EVALUATE":
      return CreateClaimAuthorizationType.EVALUATE;
    case -1:
    case "UNRECOGNIZED":
    default:
      return CreateClaimAuthorizationType.UNRECOGNIZED;
  }
}
function createClaimAuthorizationTypeToJSON(object) {
  switch (object) {
    case CreateClaimAuthorizationType.ALL:
      return "ALL";
    case CreateClaimAuthorizationType.SUBMIT:
      return "SUBMIT";
    case CreateClaimAuthorizationType.EVALUATE:
      return "EVALUATE";
    case CreateClaimAuthorizationType.UNRECOGNIZED:
    default:
      return "UNRECOGNIZED";
  }
}

/**
 * CreateClaimAuthorizationAuthorization allows a grantee to create
 * SubmitClaimAuthorization and EvaluateClaimAuthorization for specific
 * collections(constraints)
 */

/**
 * CreateClaimAuthorizationAuthorization allows a grantee to create
 * SubmitClaimAuthorization and EvaluateClaimAuthorization for specific
 * collections(constraints)
 */

/**
 * CreateClaimAuthorizationConstraints defines the constraints for creating
 * claim authorizations
 */

/**
 * CreateClaimAuthorizationConstraints defines the constraints for creating
 * claim authorizations
 */

function createBaseSubmitClaimAuthorization() {
  return {
    admin: "",
    constraints: []
  };
}
var SubmitClaimAuthorization = exports.SubmitClaimAuthorization = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.admin !== "") {
      writer.uint32(10).string(message.admin);
    }
    var _iterator = _createForOfIteratorHelper(message.constraints),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        SubmitClaimConstraints.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.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 = createBaseSubmitClaimAuthorization();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.admin = reader.string();
          break;
        case 2:
          message.constraints.push(SubmitClaimConstraints.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      admin: (0, _helpers.isSet)(object.admin) ? String(object.admin) : "",
      constraints: Array.isArray(object === null || object === void 0 ? void 0 : object.constraints) ? object.constraints.map(function (e) {
        return SubmitClaimConstraints.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.admin !== undefined && (obj.admin = message.admin);
    if (message.constraints) {
      obj.constraints = message.constraints.map(function (e) {
        return e ? SubmitClaimConstraints.toJSON(e) : undefined;
      });
    } else {
      obj.constraints = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$admin, _object$constraints;
    var message = createBaseSubmitClaimAuthorization();
    message.admin = (_object$admin = object.admin) !== null && _object$admin !== void 0 ? _object$admin : "";
    message.constraints = ((_object$constraints = object.constraints) === null || _object$constraints === void 0 ? void 0 : _object$constraints.map(function (e) {
      return SubmitClaimConstraints.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseSubmitClaimConstraints() {
  return {
    collectionId: "",
    agentQuota: _helpers.Long.UZERO,
    maxAmount: [],
    maxCw20Payment: [],
    intentDurationNs: undefined,
    maxCw1155Payment: []
  };
}
var SubmitClaimConstraints = exports.SubmitClaimConstraints = {
  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.agentQuota.isZero()) {
      writer.uint32(16).uint64(message.agentQuota);
    }
    var _iterator2 = _createForOfIteratorHelper(message.maxAmount),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var v = _step2.value;
        _coin.Coin.encode(v, writer.uint32(26).fork()).ldelim();
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
    var _iterator3 = _createForOfIteratorHelper(message.maxCw20Payment),
      _step3;
    try {
      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
        var _v = _step3.value;
        _claims.CW20Payment.encode(_v, writer.uint32(34).fork()).ldelim();
      }
    } catch (err) {
      _iterator3.e(err);
    } finally {
      _iterator3.f();
    }
    if (message.intentDurationNs !== undefined) {
      _duration.Duration.encode(message.intentDurationNs, writer.uint32(42).fork()).ldelim();
    }
    var _iterator4 = _createForOfIteratorHelper(message.maxCw1155Payment),
      _step4;
    try {
      for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
        var _v2 = _step4.value;
        _claims.CW1155Payment.encode(_v2, writer.uint32(50).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 = createBaseSubmitClaimConstraints();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.collectionId = reader.string();
          break;
        case 2:
          message.agentQuota = reader.uint64();
          break;
        case 3:
          message.maxAmount.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        case 4:
          message.maxCw20Payment.push(_claims.CW20Payment.decode(reader, reader.uint32()));
          break;
        case 5:
          message.intentDurationNs = _duration.Duration.decode(reader, reader.uint32());
          break;
        case 6:
          message.maxCw1155Payment.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) : "",
      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);
      }) : [],
      intentDurationNs: (0, _helpers.isSet)(object.intentDurationNs) ? _duration.Duration.fromJSON(object.intentDurationNs) : 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.collectionId !== undefined && (obj.collectionId = message.collectionId);
    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.intentDurationNs !== undefined && (obj.intentDurationNs = message.intentDurationNs ? _duration.Duration.toJSON(message.intentDurationNs) : undefined);
    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$collectionId, _object$maxAmount, _object$maxCw20Paymen, _object$maxCw1155Paym;
    var message = createBaseSubmitClaimConstraints();
    message.collectionId = (_object$collectionId = object.collectionId) !== null && _object$collectionId !== void 0 ? _object$collectionId : "";
    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.intentDurationNs = object.intentDurationNs !== undefined && object.intentDurationNs !== null ? _duration.Duration.fromPartial(object.intentDurationNs) : 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 createBaseEvaluateClaimAuthorization() {
  return {
    admin: "",
    constraints: []
  };
}
var EvaluateClaimAuthorization = exports.EvaluateClaimAuthorization = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.admin !== "") {
      writer.uint32(10).string(message.admin);
    }
    var _iterator5 = _createForOfIteratorHelper(message.constraints),
      _step5;
    try {
      for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
        var v = _step5.value;
        EvaluateClaimConstraints.encode(v, writer.uint32(18).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 = createBaseEvaluateClaimAuthorization();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.admin = reader.string();
          break;
        case 2:
          message.constraints.push(EvaluateClaimConstraints.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      admin: (0, _helpers.isSet)(object.admin) ? String(object.admin) : "",
      constraints: Array.isArray(object === null || object === void 0 ? void 0 : object.constraints) ? object.constraints.map(function (e) {
        return EvaluateClaimConstraints.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.admin !== undefined && (obj.admin = message.admin);
    if (message.constraints) {
      obj.constraints = message.constraints.map(function (e) {
        return e ? EvaluateClaimConstraints.toJSON(e) : undefined;
      });
    } else {
      obj.constraints = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$admin2, _object$constraints2;
    var message = createBaseEvaluateClaimAuthorization();
    message.admin = (_object$admin2 = object.admin) !== null && _object$admin2 !== void 0 ? _object$admin2 : "";
    message.constraints = ((_object$constraints2 = object.constraints) === null || _object$constraints2 === void 0 ? void 0 : _object$constraints2.map(function (e) {
      return EvaluateClaimConstraints.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseEvaluateClaimConstraints() {
  return {
    collectionId: "",
    claimIds: [],
    agentQuota: _helpers.Long.UZERO,
    beforeDate: undefined,
    maxCustomAmount: [],
    maxCustomCw20Payment: [],
    maxCustomCw1155Payment: []
  };
}
var EvaluateClaimConstraints = exports.EvaluateClaimConstraints = {
  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);
    }
    var _iterator6 = _createForOfIteratorHelper(message.claimIds),
      _step6;
    try {
      for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
        var v = _step6.value;
        writer.uint32(18).string(v);
      }
    } catch (err) {
      _iterator6.e(err);
    } finally {
      _iterator6.f();
    }
    if (!message.agentQuota.isZero()) {
      writer.uint32(24).uint64(message.agentQuota);
    }
    if (message.beforeDate !== undefined) {
      _timestamp.Timestamp.encode(message.beforeDate, writer.uint32(34).fork()).ldelim();
    }
    var _iterator7 = _createForOfIteratorHelper(message.maxCustomAmount),
      _step7;
    try {
      for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
        var _v3 = _step7.value;
        _coin.Coin.encode(_v3, writer.uint32(82).fork()).ldelim();
      }
    } catch (err) {
      _iterator7.e(err);
    } finally {
      _iterator7.f();
    }
    var _iterator8 = _createForOfIteratorHelper(message.maxCustomCw20Payment),
      _step8;
    try {
      for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
        var _v4 = _step8.value;
        _claims.CW20Payment.encode(_v4, writer.uint32(90).fork()).ldelim();
      }
    } catch (err) {
      _iterator8.e(err);
    } finally {
      _iterator8.f();
    }
    var _iterator9 = _createForOfIteratorHelper(message.maxCustomCw1155Payment),
      _step9;
    try {
      for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
        var _v5 = _step9.value;
        _claims.CW1155Payment.encode(_v5, writer.uint32(98).fork()).ldelim();
      }
    } catch (err) {
      _iterator9.e(err);
    } finally {
      _iterator9.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 = createBaseEvaluateClaimConstraints();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.collectionId = reader.string();
          break;
        case 2:
          message.claimIds.push(reader.string());
          break;
        case 3:
          message.agentQuota = reader.uint64();
          break;
        case 4:
          message.beforeDate = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 10:
          message.maxCustomAmount.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        case 11:
          message.maxCustomCw20Payment.push(_claims.CW20Payment.decode(reader, reader.uint32()));
          break;
        case 12:
          message.maxCustomCw1155Payment.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) : "",
      claimIds: Array.isArray(object === null || object === void 0 ? void 0 : object.claimIds) ? object.claimIds.map(function (e) {
        return String(e);
      }) : [],
      agentQuota: (0, _helpers.isSet)(object.agentQuota) ? _helpers.Long.fromValue(object.agentQuota) : _helpers.Long.UZERO,
      beforeDate: (0, _helpers.isSet)(object.beforeDate) ? (0, _helpers.fromJsonTimestamp)(object.beforeDate) : undefined,
      maxCustomAmount: Array.isArray(object === null || object === void 0 ? void 0 : object.maxCustomAmount) ? object.maxCustomAmount.map(function (e) {
        return _coin.Coin.fromJSON(e);
      }) : [],
      maxCustomCw20Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.maxCustomCw20Payment) ? object.maxCustomCw20Payment.map(function (e) {
        return _claims.CW20Payment.fromJSON(e);
      }) : [],
      maxCustomCw1155Payment: Array.isArray(object === null || object === void 0 ? void 0 : object.maxCustomCw1155Payment) ? object.maxCustomCw1155Payment.map(function (e) {
        return _claims.CW1155Payment.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.collectionId !== undefined && (obj.collectionId = message.collectionId);
    if (message.claimIds) {
      obj.claimIds = message.claimIds.map(function (e) {
        return e;
      });
    } else {
      obj.claimIds = [];
    }
    message.agentQuota !== undefined && (obj.agentQuota = (message.agentQuota || _helpers.Long.UZERO).toString());
    message.beforeDate !== undefined && (obj.beforeDate = (0, _helpers.fromTimestamp)(message.beforeDate).toISOString());
    if (message.maxCustomAmount) {
      obj.maxCustomAmount = message.maxCustomAmount.map(function (e) {
        return e ? _coin.Coin.toJSON(e) : undefined;
      });
    } else {
      obj.maxCustomAmount = [];
    }
    if (message.maxCustomCw20Payment) {
      obj.maxCustomCw20Payment = message.maxCustomCw20Payment.map(function (e) {
        return e ? _claims.CW20Payment.toJSON(e) : undefined;
      });
    } else {
      obj.maxCustomCw20Payment = [];
    }
    if (message.maxCustomCw1155Payment) {
      obj.maxCustomCw1155Payment = message.maxCustomCw1155Payment.map(function (e) {
        return e ? _claims.CW1155Payment.toJSON(e) : undefined;
      });
    } else {
      obj.maxCustomCw1155Payment = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$collectionId2, _object$claimIds, _object$maxCustomAmou, _object$maxCustomCw, _object$maxCustomCw2;
    var message = createBaseEvaluateClaimConstraints();
    message.collectionId = (_object$collectionId2 = object.collectionId) !== null && _object$collectionId2 !== void 0 ? _object$collectionId2 : "";
    message.claimIds = ((_object$claimIds = object.claimIds) === null || _object$claimIds === void 0 ? void 0 : _object$claimIds.map(function (e) {
      return e;
    })) || [];
    message.agentQuota = object.agentQuota !== undefined && object.agentQuota !== null ? _helpers.Long.fromValue(object.agentQuota) : _helpers.Long.UZERO;
    message.beforeDate = object.beforeDate !== undefined && object.beforeDate !== null ? _timestamp.Timestamp.fromPartial(object.beforeDate) : undefined;
    message.maxCustomAmount = ((_object$maxCustomAmou = object.maxCustomAmount) === null || _object$maxCustomAmou === void 0 ? void 0 : _object$maxCustomAmou.map(function (e) {
      return _coin.Coin.fromPartial(e);
    })) || [];
    message.maxCustomCw20Payment = ((_object$maxCustomCw = object.maxCustomCw20Payment) === null || _object$maxCustomCw === void 0 ? void 0 : _object$maxCustomCw.map(function (e) {
      return _claims.CW20Payment.fromPartial(e);
    })) || [];
    message.maxCustomCw1155Payment = ((_object$maxCustomCw2 = object.maxCustomCw1155Payment) === null || _object$maxCustomCw2 === void 0 ? void 0 : _object$maxCustomCw2.map(function (e) {
      return _claims.CW1155Payment.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseWithdrawPaymentAuthorization() {
  return {
    admin: "",
    constraints: []
  };
}
var WithdrawPaymentAuthorization = exports.WithdrawPaymentAuthorization = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.admin !== "") {
      writer.uint32(10).string(message.admin);
    }
    var _iterator0 = _createForOfIteratorHelper(message.constraints),
      _step0;
    try {
      for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
        var v = _step0.value;
        WithdrawPaymentConstraints.encode(v, writer.uint32(18).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 = createBaseWithdrawPaymentAuthorization();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.admin = reader.string();
          break;
        case 2:
          message.constraints.push(WithdrawPaymentConstraints.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      admin: (0, _helpers.isSet)(object.admin) ? String(object.admin) : "",
      constraints: Array.isArray(object === null || object === void 0 ? void 0 : object.constraints) ? object.constraints.map(function (e) {
        return WithdrawPaymentConstraints.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.admin !== undefined && (obj.admin = message.admin);
    if (message.constraints) {
      obj.constraints = message.constraints.map(function (e) {
        return e ? WithdrawPaymentConstraints.toJSON(e) : undefined;
      });
    } else {
      obj.constraints = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$admin3, _object$constraints3;
    var message = createBaseWithdrawPaymentAuthorization();
    message.admin = (_object$admin3 = object.admin) !== null && _object$admin3 !== void 0 ? _object$admin3 : "";
    message.constraints = ((_object$constraints3 = object.constraints) === null || _object$constraints3 === void 0 ? void 0 : _object$constraints3.map(function (e) {
      return WithdrawPaymentConstraints.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseWithdrawPaymentConstraints() {
  return {
    claimId: "",
    inputs: [],
    outputs: [],
    paymentType: 0,
    contract_1155Payment: undefined,
    toAddress: "",
    fromAddress: "",
    releaseDate: undefined,
    cw20Payment: [],
    cw1155Payment: []
  };
}
var WithdrawPaymentConstraints = exports.WithdrawPaymentConstraints = {
  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 _iterator1 = _createForOfIteratorHelper(message.inputs),
      _step1;
    try {
      for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
        var v = _step1.value;
        _bank.Input.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator1.e(err);
    } finally {
      _iterator1.f();
    }
    var _iterator10 = _createForOfIteratorHelper(message.outputs),
      _step10;
    try {
      for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
        var _v6 = _step10.value;
        _bank.Output.encode(_v6, writer.uint32(26).fork()).ldelim();
      }
    } catch (err) {
      _iterator10.e(err);
    } finally {
      _iterator10.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();
    }
    var _iterator11 = _createForOfIteratorHelper(message.cw20Payment),
      _step11;
    try {
      for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
        var _v7 = _step11.value;
        _claims.CW20Payment.encode(_v7, writer.uint32(74).fork()).ldelim();
      }
    } catch (err) {
      _iterator11.e(err);
    } finally {
      _iterator11.f();
    }
    var _iterator12 = _createForOfIteratorHelper(message.cw1155Payment),
      _step12;
    try {
      for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
        var _v8 = _step12.value;
        _claims.CW1155Payment.encode(_v8, writer.uint32(82).fork()).ldelim();
      }
    } catch (err) {
      _iterator12.e(err);
    } finally {
      _iterator12.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 = createBaseWithdrawPaymentConstraints();
    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.cw20Payment.push(_claims.CW20Payment.decode(reader, reader.uint32()));
          break;
        case 10:
          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,
      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());
    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$claimId, _object$inputs, _object$outputs, _object$paymentType, _object$toAddress, _object$fromAddress, _object$cw20Payment, _object$cw1155Payment;
    var message = createBaseWithdrawPaymentConstraints();
    message.claimId = (_object$claimId = object.claimId) !== null && _object$claimId !== void 0 ? _object$claimId : "";
    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.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 createBaseCreateClaimAuthorizationAuthorization() {
  return {
    admin: "",
    constraints: []
  };
}
var CreateClaimAuthorizationAuthorization = exports.CreateClaimAuthorizationAuthorization = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (message.admin !== "") {
      writer.uint32(10).string(message.admin);
    }
    var _iterator13 = _createForOfIteratorHelper(message.constraints),
      _step13;
    try {
      for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
        var v = _step13.value;
        CreateClaimAuthorizationConstraints.encode(v, writer.uint32(18).fork()).ldelim();
      }
    } catch (err) {
      _iterator13.e(err);
    } finally {
      _iterator13.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 = createBaseCreateClaimAuthorizationAuthorization();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.admin = reader.string();
          break;
        case 2:
          message.constraints.push(CreateClaimAuthorizationConstraints.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      admin: (0, _helpers.isSet)(object.admin) ? String(object.admin) : "",
      constraints: Array.isArray(object === null || object === void 0 ? void 0 : object.constraints) ? object.constraints.map(function (e) {
        return CreateClaimAuthorizationConstraints.fromJSON(e);
      }) : []
    };
  },
  toJSON: function toJSON(message) {
    var obj = {};
    message.admin !== undefined && (obj.admin = message.admin);
    if (message.constraints) {
      obj.constraints = message.constraints.map(function (e) {
        return e ? CreateClaimAuthorizationConstraints.toJSON(e) : undefined;
      });
    } else {
      obj.constraints = [];
    }
    return obj;
  },
  fromPartial: function fromPartial(object) {
    var _object$admin4, _object$constraints4;
    var message = createBaseCreateClaimAuthorizationAuthorization();
    message.admin = (_object$admin4 = object.admin) !== null && _object$admin4 !== void 0 ? _object$admin4 : "";
    message.constraints = ((_object$constraints4 = object.constraints) === null || _object$constraints4 === void 0 ? void 0 : _object$constraints4.map(function (e) {
      return CreateClaimAuthorizationConstraints.fromPartial(e);
    })) || [];
    return message;
  }
};
function createBaseCreateClaimAuthorizationConstraints() {
  return {
    maxAuthorizations: _helpers.Long.UZERO,
    maxAgentQuota: _helpers.Long.UZERO,
    maxAmount: [],
    maxCw20Payment: [],
    expiration: undefined,
    collectionIds: [],
    allowedAuthTypes: 0,
    maxIntentDurationNs: undefined,
    maxCw1155Payment: []
  };
}
var CreateClaimAuthorizationConstraints = exports.CreateClaimAuthorizationConstraints = {
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _m0.Writer.create();
    if (!message.maxAuthorizations.isZero()) {
      writer.uint32(8).uint64(message.maxAuthorizations);
    }
    if (!message.maxAgentQuota.isZero()) {
      writer.uint32(16).uint64(message.maxAgentQuota);
    }
    var _iterator14 = _createForOfIteratorHelper(message.maxAmount),
      _step14;
    try {
      for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
        var v = _step14.value;
        _coin.Coin.encode(v, writer.uint32(26).fork()).ldelim();
      }
    } catch (err) {
      _iterator14.e(err);
    } finally {
      _iterator14.f();
    }
    var _iterator15 = _createForOfIteratorHelper(message.maxCw20Payment),
      _step15;
    try {
      for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
        var _v9 = _step15.value;
        _claims.CW20Payment.encode(_v9, writer.uint32(34).fork()).ldelim();
      }
    } catch (err) {
      _iterator15.e(err);
    } finally {
      _iterator15.f();
    }
    if (message.expiration !== undefined) {
      _timestamp.Timestamp.encode(message.expiration, writer.uint32(42).fork()).ldelim();
    }
    var _iterator16 = _createForOfIteratorHelper(message.collectionIds),
      _step16;
    try {
      for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
        var _v0 = _step16.value;
        writer.uint32(50).string(_v0);
      }
    } catch (err) {
      _iterator16.e(err);
    } finally {
      _iterator16.f();
    }
    if (message.allowedAuthTypes !== 0) {
      writer.uint32(56).int32(message.allowedAuthTypes);
    }
    if (message.maxIntentDurationNs !== undefined) {
      _duration.Duration.encode(message.maxIntentDurationNs, writer.uint32(66).fork()).ldelim();
    }
    var _iterator17 = _createForOfIteratorHelper(message.maxCw1155Payment),
      _step17;
    try {
      for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
        var _v1 = _step17.value;
        _claims.CW1155Payment.encode(_v1, writer.uint32(74).fork()).ldelim();
      }
    } catch (err) {
      _iterator17.e(err);
    } finally {
      _iterator17.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 = createBaseCreateClaimAuthorizationConstraints();
    while (reader.pos < end) {
      var tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.maxAuthorizations = reader.uint64();
          break;
        case 2:
          message.maxAgentQuota = reader.uint64();
          break;
        case 3:
          message.maxAmount.push(_coin.Coin.decode(reader, reader.uint32()));
          break;
        case 4:
          message.maxCw20Payment.push(_claims.CW20Payment.decode(reader, reader.uint32()));
          break;
        case 5:
          message.expiration = _timestamp.Timestamp.decode(reader, reader.uint32());
          break;
        case 6:
          message.collectionIds.push(reader.string());
          break;
        case 7:
          message.allowedAuthTypes = reader.int32();
          break;
        case 8:
          message.maxIntentDurationNs = _duration.Duration.decode(reader, reader.uint32());
          break;
        case 9:
          message.maxCw1155Payment.push(_claims.CW1155Payment.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON: function fromJSON(object) {
    return {
      maxAuthorizations: (0, _helpers.isSet)(object.maxAuthorizations) ? _helpers.Long.fromValue(object.maxAuthorizations) : _helpers.Long.UZERO,
      maxAgentQuota: (0, _helpers.isSet)(object.maxAgentQuota) ? _helpers.Long.fromValue(object.maxAgentQuota) : _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,
      collectionIds: Array.isArray(object === null || object === void 0 ? void 0 : object.collectionIds) ? object.collectionIds.map(function (e) {
        return String(e);
      }) : [],
      allowedAuthTypes: (0, _helpers.isSet)(object.allowedAuthTypes) ? createClaimAuthorizationTypeFromJSON(object.allowedAuthTypes) : 0,
      maxIntentDurationNs: (0, _helpers.isSet)(object.maxIntentDurationNs) ? _duration.Duration.fromJSON(object.maxIntentDurationNs) : 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.maxAuthorizations !== undefined && (obj.maxAuthorizations = (message.maxAuthorizations || _helpers.Long.UZERO).toString());
    message.maxAgentQuota !== undefined && (obj.maxAgentQuota = (message.maxAgentQuota || _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());
    if (message.collectionIds) {
      obj.collectionIds = message.collectionIds.map(function (e) {
        return e;
      });
    } else {
      obj.collectionIds = [];
    }
    message.allowedAuthTypes !== undefined && (obj.allowedAuthTypes = createClaimAuthorizationTypeToJSON(message.allowedAuthTypes));
    message.maxIntentDurationNs !== undefined && (obj.maxIntentDurationNs = message.maxIntentDurationNs ? _duration.Duration.toJSON(message.maxIntentDurationNs) : undefined);
    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$maxAmount2, _object$maxCw20Paymen2, _object$collectionIds, _object$allowedAuthTy, _object$maxCw1155Paym2;
    var message = createBaseCreateClaimAuthorizationConstraints();
    message.maxAuthorizations = object.maxAuthorizations !== undefined && object.maxAuthorizations !== null ? _helpers.Long.fromValue(object.maxAuthorizations) : _helpers.Long.UZERO;
    message.maxAgentQuota = object.maxAgentQuota !== undefined && object.maxAgentQuota !== null ? _helpers.Long.fromValue(object.maxAgentQuota) : _helpers.Long.UZERO;
    message.maxAmount = ((_object$maxAmount2 = object.maxAmount) === null || _object$maxAmount2 === void 0 ? void 0 : _object$maxAmount2.map(function (e) {
      return _coin.Coin.fromPartial(e);
    })) || [];
    message.maxCw20Payment = ((_object$maxCw20Paymen2 = object.maxCw20Payment) === null || _object$maxCw20Paymen2 === void 0 ? void 0 : _object$maxCw20Paymen2.map(function (e) {
      return _claims.CW20Payment.fromPartial(e);
    })) || [];
    message.expiration = object.expiration !== undefined && object.expiration !== null ? _timestamp.Timestamp.fromPartial(object.expiration) : undefined;
    message.collectionIds = ((_object$collectionIds = object.collectionIds) === null || _object$collectionIds === void 0 ? void 0 : _object$collectionIds.map(function (e) {
      return e;
    })) || [];
    message.allowedAuthTypes = (_object$allowedAuthTy = object.allowedAuthTypes) !== null && _object$allowedAuthTy !== void 0 ? _object$allowedAuthTy : 0;
    message.maxIntentDurationNs = object.maxIntentDurationNs !== undefined && object.maxIntentDurationNs !== null ? _duration.Duration.fromPartial(object.maxIntentDurationNs) : undefined;
    message.maxCw1155Payment = ((_object$maxCw1155Paym2 = object.maxCw1155Payment) === null || _object$maxCw1155Paym2 === void 0 ? void 0 : _object$maxCw1155Paym2.map(function (e) {
      return _claims.CW1155Payment.fromPartial(e);
    })) || [];
    return message;
  }
};