import * as _m0 from "protobufjs/minimal";
function createBaseTxResponseGenericMessage() {
  return {
    header: "",
    data: new Uint8Array()
  };
}
export const TxResponseGenericMessage = {
  encode(message, writer = _m0.Writer.create()) {
    if (message.header !== "") {
      writer.uint32(10).string(message.header);
    }
    if (message.data.length !== 0) {
      writer.uint32(18).bytes(message.data);
    }
    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 = createBaseTxResponseGenericMessage();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.header = reader.string();
          break;
        case 2:
          message.data = reader.bytes();
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial(object) {
    var _object$header, _object$data;
    const message = createBaseTxResponseGenericMessage();
    message.header = (_object$header = object.header) !== null && _object$header !== void 0 ? _object$header : "";
    message.data = (_object$data = object.data) !== null && _object$data !== void 0 ? _object$data : new Uint8Array();
    return message;
  }
};
function createBaseTxResponseData() {
  return {
    messages: []
  };
}
export const TxResponseData = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.messages) {
      TxResponseGenericMessage.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 = createBaseTxResponseData();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.messages.push(TxResponseGenericMessage.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromPartial(object) {
    var _object$messages;
    const message = createBaseTxResponseData();
    message.messages = ((_object$messages = object.messages) === null || _object$messages === void 0 ? void 0 : _object$messages.map(e => TxResponseGenericMessage.fromPartial(e))) || [];
    return message;
  }
};