/* eslint-disable */ import Long from "long"; import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.mint.v1beta1"; /** Minter represents the minting state. */ export interface Minter { /** current annual inflation rate */ inflation: string; /** current annual expected provisions */ annualProvisions: string; } /** Params holds parameters for the mint module. */ export interface Params { /** type of coin to mint */ mintDenom: string; /** maximum annual change in inflation rate */ inflationRateChange: string; /** maximum inflation rate */ inflationMax: string; /** minimum inflation rate */ inflationMin: string; /** goal of percent bonded atoms */ goalBonded: string; /** expected blocks per year */ blocksPerYear: number; } function createBaseMinter(): Minter { return { inflation: "", annualProvisions: "" }; } export const Minter = { encode(message: Minter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.inflation !== "") { writer.uint32(10).string(message.inflation); } if (message.annualProvisions !== "") { writer.uint32(18).string(message.annualProvisions); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Minter { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMinter(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.inflation = reader.string(); break; case 2: message.annualProvisions = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): Minter { return { inflation: isSet(object.inflation) ? String(object.inflation) : "", annualProvisions: isSet(object.annualProvisions) ? String(object.annualProvisions) : "", }; }, toJSON(message: Minter): unknown { const obj: any = {}; message.inflation !== undefined && (obj.inflation = message.inflation); message.annualProvisions !== undefined && (obj.annualProvisions = message.annualProvisions); return obj; }, fromPartial, I>>(object: I): Minter { const message = createBaseMinter(); message.inflation = object.inflation ?? ""; message.annualProvisions = object.annualProvisions ?? ""; return message; }, }; function createBaseParams(): Params { return { mintDenom: "", inflationRateChange: "", inflationMax: "", inflationMin: "", goalBonded: "", blocksPerYear: 0, }; } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.mintDenom !== "") { writer.uint32(10).string(message.mintDenom); } if (message.inflationRateChange !== "") { writer.uint32(18).string(message.inflationRateChange); } if (message.inflationMax !== "") { writer.uint32(26).string(message.inflationMax); } if (message.inflationMin !== "") { writer.uint32(34).string(message.inflationMin); } if (message.goalBonded !== "") { writer.uint32(42).string(message.goalBonded); } if (message.blocksPerYear !== 0) { writer.uint32(48).uint64(message.blocksPerYear); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Params { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.mintDenom = reader.string(); break; case 2: message.inflationRateChange = reader.string(); break; case 3: message.inflationMax = reader.string(); break; case 4: message.inflationMin = reader.string(); break; case 5: message.goalBonded = reader.string(); break; case 6: message.blocksPerYear = longToNumber(reader.uint64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): Params { return { mintDenom: isSet(object.mintDenom) ? String(object.mintDenom) : "", inflationRateChange: isSet(object.inflationRateChange) ? String(object.inflationRateChange) : "", inflationMax: isSet(object.inflationMax) ? String(object.inflationMax) : "", inflationMin: isSet(object.inflationMin) ? String(object.inflationMin) : "", goalBonded: isSet(object.goalBonded) ? String(object.goalBonded) : "", blocksPerYear: isSet(object.blocksPerYear) ? Number(object.blocksPerYear) : 0, }; }, toJSON(message: Params): unknown { const obj: any = {}; message.mintDenom !== undefined && (obj.mintDenom = message.mintDenom); message.inflationRateChange !== undefined && (obj.inflationRateChange = message.inflationRateChange); message.inflationMax !== undefined && (obj.inflationMax = message.inflationMax); message.inflationMin !== undefined && (obj.inflationMin = message.inflationMin); message.goalBonded !== undefined && (obj.goalBonded = message.goalBonded); message.blocksPerYear !== undefined && (obj.blocksPerYear = Math.round(message.blocksPerYear)); return obj; }, fromPartial, I>>(object: I): Params { const message = createBaseParams(); message.mintDenom = object.mintDenom ?? ""; message.inflationRateChange = object.inflationRateChange ?? ""; message.inflationMax = object.inflationMax ?? ""; message.inflationMin = object.inflationMin ?? ""; message.goalBonded = object.goalBonded ?? ""; message.blocksPerYear = object.blocksPerYear ?? 0; return message; }, }; declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; var globalThis: any = (() => { if (typeof globalThis !== "undefined") { return globalThis; } if (typeof self !== "undefined") { return self; } if (typeof window !== "undefined") { return window; } if (typeof global !== "undefined") { return global; } throw "Unable to locate global object"; })(); type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); } return long.toNumber(); } if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } function isSet(value: any): boolean { return value !== null && value !== undefined; }