import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; /** GenesisState defines the crisis module's genesis state. */ export interface GenesisState { /** * constant_fee is the fee used to verify the invariant in the crisis * module. */ constantFee: Coin; } export interface GenesisStateProtoMsg { typeUrl: "/cosmos.crisis.v1beta1.GenesisState"; value: Uint8Array; } /** GenesisState defines the crisis module's genesis state. */ export interface GenesisStateAmino { /** * constant_fee is the fee used to verify the invariant in the crisis * module. */ constant_fee?: CoinAmino; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; value: GenesisStateAmino; } /** GenesisState defines the crisis module's genesis state. */ export interface GenesisStateSDKType { constant_fee: CoinSDKType; } function createBaseGenesisState(): GenesisState { return { constantFee: Coin.fromPartial({}) }; } export const GenesisState = { typeUrl: "/cosmos.crisis.v1beta1.GenesisState", encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.constantFee !== undefined) { Coin.encode(message.constantFee, writer.uint32(26).fork()).ldelim(); } return writer; }, fromJSON(object: any): GenesisState { return { constantFee: isSet(object.constantFee) ? Coin.fromJSON(object.constantFee) : undefined }; }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.constantFee = object.constantFee !== undefined && object.constantFee !== null ? Coin.fromPartial(object.constantFee) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { const message = createBaseGenesisState(); if (object.constant_fee !== undefined && object.constant_fee !== null) { message.constantFee = Coin.fromAmino(object.constant_fee); } return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; obj.constant_fee = message.constantFee ? Coin.toAmino(message.constantFee) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { return GenesisState.fromAmino(object.value); }, toAminoMsg(message: GenesisState): GenesisStateAminoMsg { return { type: "cosmos-sdk/GenesisState", value: GenesisState.toAmino(message) }; }, fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { return GenesisState.decode(message.value); }, toProto(message: GenesisState): Uint8Array { return GenesisState.encode(message).finish(); }, toProtoMsg(message: GenesisState): GenesisStateProtoMsg { return { typeUrl: "/cosmos.crisis.v1beta1.GenesisState", value: GenesisState.encode(message).finish() }; } };