//@ts-nocheck
import { BondDetails, Bond, Batch, Params } from "./bonds";
import { DecCoin, Coin } from "../../../cosmos/base/v1beta1/coin";
import * as _m0 from "protobufjs/minimal";
import { isSet } from "../../../helpers";
/** QueryBondsRequest is the request type for the Query/Bonds RPC method. */

/** QueryBondsRequest is the request type for the Query/Bonds RPC method. */

/** QueryBondsResponse is the response type for the Query/Bonds RPC method. */

/** QueryBondsResponse is the response type for the Query/Bonds RPC method. */

/**
 * QueryBondsDetailedRequest is the request type for the Query/BondsDetailed RPC
 * method.
 */

/**
 * QueryBondsDetailedRequest is the request type for the Query/BondsDetailed RPC
 * method.
 */

/**
 * QueryBondsDetailedResponse is the response type for the Query/BondsDetailed
 * RPC method.
 */

/**
 * QueryBondsDetailedResponse is the response type for the Query/BondsDetailed
 * RPC method.
 */

/** QueryBondRequest is the request type for the Query/Bond RPC method. */

/** QueryBondRequest is the request type for the Query/Bond RPC method. */

/** QueryBondResponse is the response type for the Query/Bond RPC method. */

/** QueryBondResponse is the response type for the Query/Bond RPC method. */

/** QueryBatchRequest is the request type for the Query/Batch RPC method. */

/** QueryBatchRequest is the request type for the Query/Batch RPC method. */

/** QueryBatchResponse is the response type for the Query/Batch RPC method. */

/** QueryBatchResponse is the response type for the Query/Batch RPC method. */

/** QueryLastBatchRequest is the request type for the Query/LastBatch RPC method. */

/** QueryLastBatchRequest is the request type for the Query/LastBatch RPC method. */

/**
 * QueryLastBatchResponse is the response type for the Query/LastBatch RPC
 * method.
 */

/**
 * QueryLastBatchResponse is the response type for the Query/LastBatch RPC
 * method.
 */

/**
 * QueryCurrentPriceRequest is the request type for the Query/CurrentPrice RPC
 * method.
 */

/**
 * QueryCurrentPriceRequest is the request type for the Query/CurrentPrice RPC
 * method.
 */

/**
 * QueryCurrentPriceResponse is the response type for the Query/CurrentPrice RPC
 * method.
 */

/**
 * QueryCurrentPriceResponse is the response type for the Query/CurrentPrice RPC
 * method.
 */

/**
 * QueryCurrentReserveRequest is the request type for the Query/CurrentReserve
 * RPC method.
 */

/**
 * QueryCurrentReserveRequest is the request type for the Query/CurrentReserve
 * RPC method.
 */

/**
 * QueryCurrentReserveResponse is the response type for the Query/CurrentReserve
 * RPC method.
 */

/**
 * QueryCurrentReserveResponse is the response type for the Query/CurrentReserve
 * RPC method.
 */

/**
 * QueryAvailableReserveRequest is the request type for the
 * Query/AvailableReserve RPC method.
 */

/**
 * QueryAvailableReserveRequest is the request type for the
 * Query/AvailableReserve RPC method.
 */

/**
 * QueryAvailableReserveResponse is the response type for the
 * Query/AvailableReserve RPC method.
 */

/**
 * QueryAvailableReserveResponse is the response type for the
 * Query/AvailableReserve RPC method.
 */

/**
 * QueryCustomPriceRequest is the request type for the Query/CustomPrice RPC
 * method.
 */

/**
 * QueryCustomPriceRequest is the request type for the Query/CustomPrice RPC
 * method.
 */

/**
 * QueryCustomPriceResponse is the response type for the Query/CustomPrice RPC
 * method.
 */

/**
 * QueryCustomPriceResponse is the response type for the Query/CustomPrice RPC
 * method.
 */

/**
 * QueryCustomPriceRequest is the request type for the Query/BuyPrice RPC
 * method.
 */

/**
 * QueryCustomPriceRequest is the request type for the Query/BuyPrice RPC
 * method.
 */

/**
 * QueryCustomPriceResponse is the response type for the Query/BuyPrice RPC
 * method.
 */

/**
 * QueryCustomPriceResponse is the response type for the Query/BuyPrice RPC
 * method.
 */

/**
 * QuerySellReturnRequest is the request type for the Query/SellReturn RPC
 * method.
 */

/**
 * QuerySellReturnRequest is the request type for the Query/SellReturn RPC
 * method.
 */

/**
 * QuerySellReturnResponse is the response type for the Query/SellReturn RPC
 * method.
 */

/**
 * QuerySellReturnResponse is the response type for the Query/SellReturn RPC
 * method.
 */

/**
 * QuerySwapReturnRequest is the request type for the Query/SwapReturn RPC
 * method.
 */

/**
 * QuerySwapReturnRequest is the request type for the Query/SwapReturn RPC
 * method.
 */

/**
 * QuerySwapReturnResponse is the response type for the Query/SwapReturn RPC
 * method.
 */

/**
 * QuerySwapReturnResponse is the response type for the Query/SwapReturn RPC
 * method.
 */

/**
 * QueryAlphaMaximumsRequest is the request type for the Query/AlphaMaximums RPC
 * method.
 */

/**
 * QueryAlphaMaximumsRequest is the request type for the Query/AlphaMaximums RPC
 * method.
 */

/**
 * QueryAlphaMaximumsResponse is the response type for the Query/AlphaMaximums
 * RPC method.
 */

/**
 * QueryAlphaMaximumsResponse is the response type for the Query/AlphaMaximums
 * RPC method.
 */

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

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

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

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

function createBaseQueryBondsRequest() {
  return {};
}
export const QueryBondsRequest = {
  encode(_, writer = _m0.Writer.create()) {
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryBondsRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseQueryBondsRequest();
    return message;
  }
};
function createBaseQueryBondsResponse() {
  return {
    bonds: []
  };
}
export const QueryBondsResponse = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.bonds) {
      writer.uint32(10).string(v);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryBondsResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bonds.push(reader.string());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bonds: Array.isArray(object === null || object === void 0 ? void 0 : object.bonds) ? object.bonds.map(e => String(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    if (message.bonds) {
      obj.bonds = message.bonds.map(e => e);
    } else {
      obj.bonds = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$bonds;
    const message = createBaseQueryBondsResponse();
    message.bonds = ((_object$bonds = object.bonds) === null || _object$bonds === void 0 ? void 0 : _object$bonds.map(e => e)) || [];
    return message;
  }
};
function createBaseQueryBondsDetailedRequest() {
  return {};
}
export const QueryBondsDetailedRequest = {
  encode(_, writer = _m0.Writer.create()) {
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryBondsDetailedRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseQueryBondsDetailedRequest();
    return message;
  }
};
function createBaseQueryBondsDetailedResponse() {
  return {
    bondsDetailed: []
  };
}
export const QueryBondsDetailedResponse = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.bondsDetailed) {
      BondDetails.encode(v, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryBondsDetailedResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondsDetailed.push(BondDetails.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondsDetailed: Array.isArray(object === null || object === void 0 ? void 0 : object.bondsDetailed) ? object.bondsDetailed.map(e => BondDetails.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    if (message.bondsDetailed) {
      obj.bondsDetailed = message.bondsDetailed.map(e => e ? BondDetails.toJSON(e) : undefined);
    } else {
      obj.bondsDetailed = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$bondsDetailed;
    const message = createBaseQueryBondsDetailedResponse();
    message.bondsDetailed = ((_object$bondsDetailed = object.bondsDetailed) === null || _object$bondsDetailed === void 0 ? void 0 : _object$bondsDetailed.map(e => BondDetails.fromPartial(e))) || [];
    return message;
  }
};
function createBaseQueryBondRequest() {
  return {
    bondDid: ""
  };
}
export const QueryBondRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryBondRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid;
    const message = createBaseQueryBondRequest();
    message.bondDid = (_object$bondDid = object.bondDid) !== null && _object$bondDid !== void 0 ? _object$bondDid : "";
    return message;
  }
};
function createBaseQueryBondResponse() {
  return {
    bond: undefined
  };
}
export const QueryBondResponse = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bond !== undefined) {
      Bond.encode(message.bond, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryBondResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bond = Bond.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bond: isSet(object.bond) ? Bond.fromJSON(object.bond) : undefined
    };
  },
  toJSON(message) {
    const obj = {};
    message.bond !== undefined && (obj.bond = message.bond ? Bond.toJSON(message.bond) : undefined);
    return obj;
  },
  fromPartial(object) {
    const message = createBaseQueryBondResponse();
    message.bond = object.bond !== undefined && object.bond !== null ? Bond.fromPartial(object.bond) : undefined;
    return message;
  }
};
function createBaseQueryBatchRequest() {
  return {
    bondDid: ""
  };
}
export const QueryBatchRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryBatchRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid2;
    const message = createBaseQueryBatchRequest();
    message.bondDid = (_object$bondDid2 = object.bondDid) !== null && _object$bondDid2 !== void 0 ? _object$bondDid2 : "";
    return message;
  }
};
function createBaseQueryBatchResponse() {
  return {
    batch: undefined
  };
}
export const QueryBatchResponse = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.batch !== undefined) {
      Batch.encode(message.batch, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryBatchResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.batch = Batch.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      batch: isSet(object.batch) ? Batch.fromJSON(object.batch) : undefined
    };
  },
  toJSON(message) {
    const obj = {};
    message.batch !== undefined && (obj.batch = message.batch ? Batch.toJSON(message.batch) : undefined);
    return obj;
  },
  fromPartial(object) {
    const message = createBaseQueryBatchResponse();
    message.batch = object.batch !== undefined && object.batch !== null ? Batch.fromPartial(object.batch) : undefined;
    return message;
  }
};
function createBaseQueryLastBatchRequest() {
  return {
    bondDid: ""
  };
}
export const QueryLastBatchRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryLastBatchRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid3;
    const message = createBaseQueryLastBatchRequest();
    message.bondDid = (_object$bondDid3 = object.bondDid) !== null && _object$bondDid3 !== void 0 ? _object$bondDid3 : "";
    return message;
  }
};
function createBaseQueryLastBatchResponse() {
  return {
    lastBatch: undefined
  };
}
export const QueryLastBatchResponse = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.lastBatch !== undefined) {
      Batch.encode(message.lastBatch, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryLastBatchResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.lastBatch = Batch.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      lastBatch: isSet(object.lastBatch) ? Batch.fromJSON(object.lastBatch) : undefined
    };
  },
  toJSON(message) {
    const obj = {};
    message.lastBatch !== undefined && (obj.lastBatch = message.lastBatch ? Batch.toJSON(message.lastBatch) : undefined);
    return obj;
  },
  fromPartial(object) {
    const message = createBaseQueryLastBatchResponse();
    message.lastBatch = object.lastBatch !== undefined && object.lastBatch !== null ? Batch.fromPartial(object.lastBatch) : undefined;
    return message;
  }
};
function createBaseQueryCurrentPriceRequest() {
  return {
    bondDid: ""
  };
}
export const QueryCurrentPriceRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryCurrentPriceRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid4;
    const message = createBaseQueryCurrentPriceRequest();
    message.bondDid = (_object$bondDid4 = object.bondDid) !== null && _object$bondDid4 !== void 0 ? _object$bondDid4 : "";
    return message;
  }
};
function createBaseQueryCurrentPriceResponse() {
  return {
    currentPrice: []
  };
}
export const QueryCurrentPriceResponse = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.currentPrice) {
      DecCoin.encode(v, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryCurrentPriceResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.currentPrice.push(DecCoin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      currentPrice: Array.isArray(object === null || object === void 0 ? void 0 : object.currentPrice) ? object.currentPrice.map(e => DecCoin.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    if (message.currentPrice) {
      obj.currentPrice = message.currentPrice.map(e => e ? DecCoin.toJSON(e) : undefined);
    } else {
      obj.currentPrice = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$currentPrice;
    const message = createBaseQueryCurrentPriceResponse();
    message.currentPrice = ((_object$currentPrice = object.currentPrice) === null || _object$currentPrice === void 0 ? void 0 : _object$currentPrice.map(e => DecCoin.fromPartial(e))) || [];
    return message;
  }
};
function createBaseQueryCurrentReserveRequest() {
  return {
    bondDid: ""
  };
}
export const QueryCurrentReserveRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryCurrentReserveRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid5;
    const message = createBaseQueryCurrentReserveRequest();
    message.bondDid = (_object$bondDid5 = object.bondDid) !== null && _object$bondDid5 !== void 0 ? _object$bondDid5 : "";
    return message;
  }
};
function createBaseQueryCurrentReserveResponse() {
  return {
    currentReserve: []
  };
}
export const QueryCurrentReserveResponse = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.currentReserve) {
      Coin.encode(v, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryCurrentReserveResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.currentReserve.push(Coin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      currentReserve: Array.isArray(object === null || object === void 0 ? void 0 : object.currentReserve) ? object.currentReserve.map(e => Coin.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    if (message.currentReserve) {
      obj.currentReserve = message.currentReserve.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.currentReserve = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$currentReserv;
    const message = createBaseQueryCurrentReserveResponse();
    message.currentReserve = ((_object$currentReserv = object.currentReserve) === null || _object$currentReserv === void 0 ? void 0 : _object$currentReserv.map(e => Coin.fromPartial(e))) || [];
    return message;
  }
};
function createBaseQueryAvailableReserveRequest() {
  return {
    bondDid: ""
  };
}
export const QueryAvailableReserveRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryAvailableReserveRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid6;
    const message = createBaseQueryAvailableReserveRequest();
    message.bondDid = (_object$bondDid6 = object.bondDid) !== null && _object$bondDid6 !== void 0 ? _object$bondDid6 : "";
    return message;
  }
};
function createBaseQueryAvailableReserveResponse() {
  return {
    availableReserve: []
  };
}
export const QueryAvailableReserveResponse = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.availableReserve) {
      Coin.encode(v, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryAvailableReserveResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.availableReserve.push(Coin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      availableReserve: Array.isArray(object === null || object === void 0 ? void 0 : object.availableReserve) ? object.availableReserve.map(e => Coin.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    if (message.availableReserve) {
      obj.availableReserve = message.availableReserve.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.availableReserve = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$availableRese;
    const message = createBaseQueryAvailableReserveResponse();
    message.availableReserve = ((_object$availableRese = object.availableReserve) === null || _object$availableRese === void 0 ? void 0 : _object$availableRese.map(e => Coin.fromPartial(e))) || [];
    return message;
  }
};
function createBaseQueryCustomPriceRequest() {
  return {
    bondDid: "",
    bondAmount: ""
  };
}
export const QueryCustomPriceRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    if (message.bondAmount !== "") {
      writer.uint32(18).string(message.bondAmount);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryCustomPriceRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        case 2:
          message.bondAmount = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : "",
      bondAmount: isSet(object.bondAmount) ? String(object.bondAmount) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    message.bondAmount !== undefined && (obj.bondAmount = message.bondAmount);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid7, _object$bondAmount;
    const message = createBaseQueryCustomPriceRequest();
    message.bondDid = (_object$bondDid7 = object.bondDid) !== null && _object$bondDid7 !== void 0 ? _object$bondDid7 : "";
    message.bondAmount = (_object$bondAmount = object.bondAmount) !== null && _object$bondAmount !== void 0 ? _object$bondAmount : "";
    return message;
  }
};
function createBaseQueryCustomPriceResponse() {
  return {
    price: []
  };
}
export const QueryCustomPriceResponse = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.price) {
      DecCoin.encode(v, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryCustomPriceResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.price.push(DecCoin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      price: Array.isArray(object === null || object === void 0 ? void 0 : object.price) ? object.price.map(e => DecCoin.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    if (message.price) {
      obj.price = message.price.map(e => e ? DecCoin.toJSON(e) : undefined);
    } else {
      obj.price = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$price;
    const message = createBaseQueryCustomPriceResponse();
    message.price = ((_object$price = object.price) === null || _object$price === void 0 ? void 0 : _object$price.map(e => DecCoin.fromPartial(e))) || [];
    return message;
  }
};
function createBaseQueryBuyPriceRequest() {
  return {
    bondDid: "",
    bondAmount: ""
  };
}
export const QueryBuyPriceRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    if (message.bondAmount !== "") {
      writer.uint32(18).string(message.bondAmount);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryBuyPriceRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        case 2:
          message.bondAmount = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : "",
      bondAmount: isSet(object.bondAmount) ? String(object.bondAmount) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    message.bondAmount !== undefined && (obj.bondAmount = message.bondAmount);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid8, _object$bondAmount2;
    const message = createBaseQueryBuyPriceRequest();
    message.bondDid = (_object$bondDid8 = object.bondDid) !== null && _object$bondDid8 !== void 0 ? _object$bondDid8 : "";
    message.bondAmount = (_object$bondAmount2 = object.bondAmount) !== null && _object$bondAmount2 !== void 0 ? _object$bondAmount2 : "";
    return message;
  }
};
function createBaseQueryBuyPriceResponse() {
  return {
    adjustedSupply: undefined,
    prices: [],
    txFees: [],
    totalPrices: [],
    totalFees: []
  };
}
export const QueryBuyPriceResponse = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.adjustedSupply !== undefined) {
      Coin.encode(message.adjustedSupply, writer.uint32(10).fork()).ldelim();
    }
    for (const v of message.prices) {
      Coin.encode(v, writer.uint32(18).fork()).ldelim();
    }
    for (const v of message.txFees) {
      Coin.encode(v, writer.uint32(26).fork()).ldelim();
    }
    for (const v of message.totalPrices) {
      Coin.encode(v, writer.uint32(34).fork()).ldelim();
    }
    for (const v of message.totalFees) {
      Coin.encode(v, writer.uint32(42).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryBuyPriceResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.adjustedSupply = Coin.decode(reader, reader.uint32());
          break;
        case 2:
          message.prices.push(Coin.decode(reader, reader.uint32()));
          break;
        case 3:
          message.txFees.push(Coin.decode(reader, reader.uint32()));
          break;
        case 4:
          message.totalPrices.push(Coin.decode(reader, reader.uint32()));
          break;
        case 5:
          message.totalFees.push(Coin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      adjustedSupply: isSet(object.adjustedSupply) ? Coin.fromJSON(object.adjustedSupply) : undefined,
      prices: Array.isArray(object === null || object === void 0 ? void 0 : object.prices) ? object.prices.map(e => Coin.fromJSON(e)) : [],
      txFees: Array.isArray(object === null || object === void 0 ? void 0 : object.txFees) ? object.txFees.map(e => Coin.fromJSON(e)) : [],
      totalPrices: Array.isArray(object === null || object === void 0 ? void 0 : object.totalPrices) ? object.totalPrices.map(e => Coin.fromJSON(e)) : [],
      totalFees: Array.isArray(object === null || object === void 0 ? void 0 : object.totalFees) ? object.totalFees.map(e => Coin.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    message.adjustedSupply !== undefined && (obj.adjustedSupply = message.adjustedSupply ? Coin.toJSON(message.adjustedSupply) : undefined);
    if (message.prices) {
      obj.prices = message.prices.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.prices = [];
    }
    if (message.txFees) {
      obj.txFees = message.txFees.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.txFees = [];
    }
    if (message.totalPrices) {
      obj.totalPrices = message.totalPrices.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.totalPrices = [];
    }
    if (message.totalFees) {
      obj.totalFees = message.totalFees.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.totalFees = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$prices, _object$txFees, _object$totalPrices, _object$totalFees;
    const message = createBaseQueryBuyPriceResponse();
    message.adjustedSupply = object.adjustedSupply !== undefined && object.adjustedSupply !== null ? Coin.fromPartial(object.adjustedSupply) : undefined;
    message.prices = ((_object$prices = object.prices) === null || _object$prices === void 0 ? void 0 : _object$prices.map(e => Coin.fromPartial(e))) || [];
    message.txFees = ((_object$txFees = object.txFees) === null || _object$txFees === void 0 ? void 0 : _object$txFees.map(e => Coin.fromPartial(e))) || [];
    message.totalPrices = ((_object$totalPrices = object.totalPrices) === null || _object$totalPrices === void 0 ? void 0 : _object$totalPrices.map(e => Coin.fromPartial(e))) || [];
    message.totalFees = ((_object$totalFees = object.totalFees) === null || _object$totalFees === void 0 ? void 0 : _object$totalFees.map(e => Coin.fromPartial(e))) || [];
    return message;
  }
};
function createBaseQuerySellReturnRequest() {
  return {
    bondDid: "",
    bondAmount: ""
  };
}
export const QuerySellReturnRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    if (message.bondAmount !== "") {
      writer.uint32(18).string(message.bondAmount);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQuerySellReturnRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        case 2:
          message.bondAmount = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : "",
      bondAmount: isSet(object.bondAmount) ? String(object.bondAmount) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    message.bondAmount !== undefined && (obj.bondAmount = message.bondAmount);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid9, _object$bondAmount3;
    const message = createBaseQuerySellReturnRequest();
    message.bondDid = (_object$bondDid9 = object.bondDid) !== null && _object$bondDid9 !== void 0 ? _object$bondDid9 : "";
    message.bondAmount = (_object$bondAmount3 = object.bondAmount) !== null && _object$bondAmount3 !== void 0 ? _object$bondAmount3 : "";
    return message;
  }
};
function createBaseQuerySellReturnResponse() {
  return {
    adjustedSupply: undefined,
    returns: [],
    txFees: [],
    exitFees: [],
    totalReturns: [],
    totalFees: []
  };
}
export const QuerySellReturnResponse = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.adjustedSupply !== undefined) {
      Coin.encode(message.adjustedSupply, writer.uint32(10).fork()).ldelim();
    }
    for (const v of message.returns) {
      Coin.encode(v, writer.uint32(18).fork()).ldelim();
    }
    for (const v of message.txFees) {
      Coin.encode(v, writer.uint32(26).fork()).ldelim();
    }
    for (const v of message.exitFees) {
      Coin.encode(v, writer.uint32(34).fork()).ldelim();
    }
    for (const v of message.totalReturns) {
      Coin.encode(v, writer.uint32(42).fork()).ldelim();
    }
    for (const v of message.totalFees) {
      Coin.encode(v, writer.uint32(50).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQuerySellReturnResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.adjustedSupply = Coin.decode(reader, reader.uint32());
          break;
        case 2:
          message.returns.push(Coin.decode(reader, reader.uint32()));
          break;
        case 3:
          message.txFees.push(Coin.decode(reader, reader.uint32()));
          break;
        case 4:
          message.exitFees.push(Coin.decode(reader, reader.uint32()));
          break;
        case 5:
          message.totalReturns.push(Coin.decode(reader, reader.uint32()));
          break;
        case 6:
          message.totalFees.push(Coin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      adjustedSupply: isSet(object.adjustedSupply) ? Coin.fromJSON(object.adjustedSupply) : undefined,
      returns: Array.isArray(object === null || object === void 0 ? void 0 : object.returns) ? object.returns.map(e => Coin.fromJSON(e)) : [],
      txFees: Array.isArray(object === null || object === void 0 ? void 0 : object.txFees) ? object.txFees.map(e => Coin.fromJSON(e)) : [],
      exitFees: Array.isArray(object === null || object === void 0 ? void 0 : object.exitFees) ? object.exitFees.map(e => Coin.fromJSON(e)) : [],
      totalReturns: Array.isArray(object === null || object === void 0 ? void 0 : object.totalReturns) ? object.totalReturns.map(e => Coin.fromJSON(e)) : [],
      totalFees: Array.isArray(object === null || object === void 0 ? void 0 : object.totalFees) ? object.totalFees.map(e => Coin.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    message.adjustedSupply !== undefined && (obj.adjustedSupply = message.adjustedSupply ? Coin.toJSON(message.adjustedSupply) : undefined);
    if (message.returns) {
      obj.returns = message.returns.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.returns = [];
    }
    if (message.txFees) {
      obj.txFees = message.txFees.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.txFees = [];
    }
    if (message.exitFees) {
      obj.exitFees = message.exitFees.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.exitFees = [];
    }
    if (message.totalReturns) {
      obj.totalReturns = message.totalReturns.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.totalReturns = [];
    }
    if (message.totalFees) {
      obj.totalFees = message.totalFees.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.totalFees = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$returns, _object$txFees2, _object$exitFees, _object$totalReturns, _object$totalFees2;
    const message = createBaseQuerySellReturnResponse();
    message.adjustedSupply = object.adjustedSupply !== undefined && object.adjustedSupply !== null ? Coin.fromPartial(object.adjustedSupply) : undefined;
    message.returns = ((_object$returns = object.returns) === null || _object$returns === void 0 ? void 0 : _object$returns.map(e => Coin.fromPartial(e))) || [];
    message.txFees = ((_object$txFees2 = object.txFees) === null || _object$txFees2 === void 0 ? void 0 : _object$txFees2.map(e => Coin.fromPartial(e))) || [];
    message.exitFees = ((_object$exitFees = object.exitFees) === null || _object$exitFees === void 0 ? void 0 : _object$exitFees.map(e => Coin.fromPartial(e))) || [];
    message.totalReturns = ((_object$totalReturns = object.totalReturns) === null || _object$totalReturns === void 0 ? void 0 : _object$totalReturns.map(e => Coin.fromPartial(e))) || [];
    message.totalFees = ((_object$totalFees2 = object.totalFees) === null || _object$totalFees2 === void 0 ? void 0 : _object$totalFees2.map(e => Coin.fromPartial(e))) || [];
    return message;
  }
};
function createBaseQuerySwapReturnRequest() {
  return {
    bondDid: "",
    fromTokenWithAmount: "",
    toToken: ""
  };
}
export const QuerySwapReturnRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    if (message.fromTokenWithAmount !== "") {
      writer.uint32(18).string(message.fromTokenWithAmount);
    }
    if (message.toToken !== "") {
      writer.uint32(26).string(message.toToken);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQuerySwapReturnRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        case 2:
          message.fromTokenWithAmount = reader.string();
          break;
        case 3:
          message.toToken = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : "",
      fromTokenWithAmount: isSet(object.fromTokenWithAmount) ? String(object.fromTokenWithAmount) : "",
      toToken: isSet(object.toToken) ? String(object.toToken) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    message.fromTokenWithAmount !== undefined && (obj.fromTokenWithAmount = message.fromTokenWithAmount);
    message.toToken !== undefined && (obj.toToken = message.toToken);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid0, _object$fromTokenWith, _object$toToken;
    const message = createBaseQuerySwapReturnRequest();
    message.bondDid = (_object$bondDid0 = object.bondDid) !== null && _object$bondDid0 !== void 0 ? _object$bondDid0 : "";
    message.fromTokenWithAmount = (_object$fromTokenWith = object.fromTokenWithAmount) !== null && _object$fromTokenWith !== void 0 ? _object$fromTokenWith : "";
    message.toToken = (_object$toToken = object.toToken) !== null && _object$toToken !== void 0 ? _object$toToken : "";
    return message;
  }
};
function createBaseQuerySwapReturnResponse() {
  return {
    totalReturns: [],
    totalFees: []
  };
}
export const QuerySwapReturnResponse = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.totalReturns) {
      Coin.encode(v, writer.uint32(10).fork()).ldelim();
    }
    for (const v of message.totalFees) {
      Coin.encode(v, writer.uint32(18).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQuerySwapReturnResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.totalReturns.push(Coin.decode(reader, reader.uint32()));
          break;
        case 2:
          message.totalFees.push(Coin.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      totalReturns: Array.isArray(object === null || object === void 0 ? void 0 : object.totalReturns) ? object.totalReturns.map(e => Coin.fromJSON(e)) : [],
      totalFees: Array.isArray(object === null || object === void 0 ? void 0 : object.totalFees) ? object.totalFees.map(e => Coin.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    if (message.totalReturns) {
      obj.totalReturns = message.totalReturns.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.totalReturns = [];
    }
    if (message.totalFees) {
      obj.totalFees = message.totalFees.map(e => e ? Coin.toJSON(e) : undefined);
    } else {
      obj.totalFees = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$totalReturns2, _object$totalFees3;
    const message = createBaseQuerySwapReturnResponse();
    message.totalReturns = ((_object$totalReturns2 = object.totalReturns) === null || _object$totalReturns2 === void 0 ? void 0 : _object$totalReturns2.map(e => Coin.fromPartial(e))) || [];
    message.totalFees = ((_object$totalFees3 = object.totalFees) === null || _object$totalFees3 === void 0 ? void 0 : _object$totalFees3.map(e => Coin.fromPartial(e))) || [];
    return message;
  }
};
function createBaseQueryAlphaMaximumsRequest() {
  return {
    bondDid: ""
  };
}
export const QueryAlphaMaximumsRequest = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.bondDid !== "") {
      writer.uint32(10).string(message.bondDid);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryAlphaMaximumsRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.bondDid = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      bondDid: isSet(object.bondDid) ? String(object.bondDid) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.bondDid !== undefined && (obj.bondDid = message.bondDid);
    return obj;
  },
  fromPartial(object) {
    var _object$bondDid1;
    const message = createBaseQueryAlphaMaximumsRequest();
    message.bondDid = (_object$bondDid1 = object.bondDid) !== null && _object$bondDid1 !== void 0 ? _object$bondDid1 : "";
    return message;
  }
};
function createBaseQueryAlphaMaximumsResponse() {
  return {
    maxSystemAlphaIncrease: "",
    maxSystemAlpha: ""
  };
}
export const QueryAlphaMaximumsResponse = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.maxSystemAlphaIncrease !== "") {
      writer.uint32(10).string(message.maxSystemAlphaIncrease);
    }
    if (message.maxSystemAlpha !== "") {
      writer.uint32(18).string(message.maxSystemAlpha);
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryAlphaMaximumsResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.maxSystemAlphaIncrease = reader.string();
          break;
        case 2:
          message.maxSystemAlpha = reader.string();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      maxSystemAlphaIncrease: isSet(object.maxSystemAlphaIncrease) ? String(object.maxSystemAlphaIncrease) : "",
      maxSystemAlpha: isSet(object.maxSystemAlpha) ? String(object.maxSystemAlpha) : ""
    };
  },
  toJSON(message) {
    const obj = {};
    message.maxSystemAlphaIncrease !== undefined && (obj.maxSystemAlphaIncrease = message.maxSystemAlphaIncrease);
    message.maxSystemAlpha !== undefined && (obj.maxSystemAlpha = message.maxSystemAlpha);
    return obj;
  },
  fromPartial(object) {
    var _object$maxSystemAlph, _object$maxSystemAlph2;
    const message = createBaseQueryAlphaMaximumsResponse();
    message.maxSystemAlphaIncrease = (_object$maxSystemAlph = object.maxSystemAlphaIncrease) !== null && _object$maxSystemAlph !== void 0 ? _object$maxSystemAlph : "";
    message.maxSystemAlpha = (_object$maxSystemAlph2 = object.maxSystemAlpha) !== null && _object$maxSystemAlph2 !== void 0 ? _object$maxSystemAlph2 : "";
    return message;
  }
};
function createBaseQueryParamsRequest() {
  return {};
}
export const QueryParamsRequest = {
  encode(_, writer = _m0.Writer.create()) {
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryParamsRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(_) {
    return {};
  },
  toJSON(_) {
    const obj = {};
    return obj;
  },
  fromPartial(_) {
    const message = createBaseQueryParamsRequest();
    return message;
  }
};
function createBaseQueryParamsResponse() {
  return {
    params: undefined
  };
}
export const QueryParamsResponse = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.params !== undefined) {
      Params.encode(message.params, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseQueryParamsResponse();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.params = Params.decode(reader, reader.uint32());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      params: isSet(object.params) ? Params.fromJSON(object.params) : undefined
    };
  },
  toJSON(message) {
    const obj = {};
    message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined);
    return obj;
  },
  fromPartial(object) {
    const message = createBaseQueryParamsResponse();
    message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined;
    return message;
  }
};