"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.IntProto = exports.DecProto = exports.DecCoin = exports.Coin = void 0;
var _binary = require("../../../binary");
var _helpers = require("../../../helpers");
/**
 * Coin defines a token with a denomination and an amount.
 * 
 * NOTE: The amount field is an Int which implements the custom method
 * signatures required by gogoproto.
 */

/**
 * Coin defines a token with a denomination and an amount.
 * 
 * NOTE: The amount field is an Int which implements the custom method
 * signatures required by gogoproto.
 */

/**
 * Coin defines a token with a denomination and an amount.
 * 
 * NOTE: The amount field is an Int which implements the custom method
 * signatures required by gogoproto.
 */

/**
 * DecCoin defines a token with a denomination and a decimal amount.
 * 
 * NOTE: The amount field is an Dec which implements the custom method
 * signatures required by gogoproto.
 */

/**
 * DecCoin defines a token with a denomination and a decimal amount.
 * 
 * NOTE: The amount field is an Dec which implements the custom method
 * signatures required by gogoproto.
 */

/**
 * DecCoin defines a token with a denomination and a decimal amount.
 * 
 * NOTE: The amount field is an Dec which implements the custom method
 * signatures required by gogoproto.
 */

/** IntProto defines a Protobuf wrapper around an Int object. */

/** IntProto defines a Protobuf wrapper around an Int object. */

/** IntProto defines a Protobuf wrapper around an Int object. */

/** DecProto defines a Protobuf wrapper around a Dec object. */

/** DecProto defines a Protobuf wrapper around a Dec object. */

/** DecProto defines a Protobuf wrapper around a Dec object. */

function createBaseCoin() {
  return {
    denom: "",
    amount: ""
  };
}
var Coin = exports.Coin = {
  typeUrl: "/cosmos.base.v1beta1.Coin",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.denom !== "") {
      writer.uint32(10).string(message.denom);
    }
    if (message.amount !== "") {
      writer.uint32(18).string(message.amount);
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      denom: (0, _helpers.isSet)(object.denom) ? String(object.denom) : "",
      amount: (0, _helpers.isSet)(object.amount) ? String(object.amount) : ""
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$denom, _object$amount;
    var message = createBaseCoin();
    message.denom = (_object$denom = object.denom) !== null && _object$denom !== void 0 ? _object$denom : "";
    message.amount = (_object$amount = object.amount) !== null && _object$amount !== void 0 ? _object$amount : "";
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseCoin();
    if (object.denom !== undefined && object.denom !== null) {
      message.denom = object.denom;
    }
    if (object.amount !== undefined && object.amount !== null) {
      message.amount = object.amount;
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.denom = message.denom === "" ? undefined : message.denom;
    obj.amount = message.amount === "" ? undefined : message.amount;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return Coin.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/Coin",
      value: Coin.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return Coin.decode(message.value);
  },
  toProto: function toProto(message) {
    return Coin.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.base.v1beta1.Coin",
      value: Coin.encode(message).finish()
    };
  }
};
function createBaseDecCoin() {
  return {
    denom: "",
    amount: ""
  };
}
var DecCoin = exports.DecCoin = {
  typeUrl: "/cosmos.base.v1beta1.DecCoin",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.denom !== "") {
      writer.uint32(10).string(message.denom);
    }
    if (message.amount !== "") {
      writer.uint32(18).string(message.amount);
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      denom: (0, _helpers.isSet)(object.denom) ? String(object.denom) : "",
      amount: (0, _helpers.isSet)(object.amount) ? String(object.amount) : ""
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$denom2, _object$amount2;
    var message = createBaseDecCoin();
    message.denom = (_object$denom2 = object.denom) !== null && _object$denom2 !== void 0 ? _object$denom2 : "";
    message.amount = (_object$amount2 = object.amount) !== null && _object$amount2 !== void 0 ? _object$amount2 : "";
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseDecCoin();
    if (object.denom !== undefined && object.denom !== null) {
      message.denom = object.denom;
    }
    if (object.amount !== undefined && object.amount !== null) {
      message.amount = object.amount;
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.denom = message.denom === "" ? undefined : message.denom;
    obj.amount = message.amount === "" ? undefined : message.amount;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return DecCoin.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/DecCoin",
      value: DecCoin.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return DecCoin.decode(message.value);
  },
  toProto: function toProto(message) {
    return DecCoin.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.base.v1beta1.DecCoin",
      value: DecCoin.encode(message).finish()
    };
  }
};
function createBaseIntProto() {
  return {
    "int": ""
  };
}
var IntProto = exports.IntProto = {
  typeUrl: "/cosmos.base.v1beta1.IntProto",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message["int"] !== "") {
      writer.uint32(10).string(message["int"]);
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      "int": (0, _helpers.isSet)(object["int"]) ? String(object["int"]) : ""
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$int;
    var message = createBaseIntProto();
    message["int"] = (_object$int = object["int"]) !== null && _object$int !== void 0 ? _object$int : "";
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseIntProto();
    if (object["int"] !== undefined && object["int"] !== null) {
      message["int"] = object["int"];
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj["int"] = message["int"] === "" ? undefined : message["int"];
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return IntProto.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/IntProto",
      value: IntProto.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return IntProto.decode(message.value);
  },
  toProto: function toProto(message) {
    return IntProto.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.base.v1beta1.IntProto",
      value: IntProto.encode(message).finish()
    };
  }
};
function createBaseDecProto() {
  return {
    dec: ""
  };
}
var DecProto = exports.DecProto = {
  typeUrl: "/cosmos.base.v1beta1.DecProto",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.dec !== "") {
      writer.uint32(10).string(message.dec);
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      dec: (0, _helpers.isSet)(object.dec) ? String(object.dec) : ""
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$dec;
    var message = createBaseDecProto();
    message.dec = (_object$dec = object.dec) !== null && _object$dec !== void 0 ? _object$dec : "";
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseDecProto();
    if (object.dec !== undefined && object.dec !== null) {
      message.dec = object.dec;
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.dec = message.dec === "" ? undefined : message.dec;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return DecProto.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/DecProto",
      value: DecProto.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return DecProto.decode(message.value);
  },
  toProto: function toProto(message) {
    return DecProto.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.base.v1beta1.DecProto",
      value: DecProto.encode(message).finish()
    };
  }
};