|
| 1 | +/* eslint-disable */ |
| 2 | +import Long from 'long'; |
| 3 | +import _m0 from 'protobufjs/minimal'; |
| 4 | + |
| 5 | +export const protobufPackage = 'cosmos.mint.v1beta1'; |
| 6 | + |
| 7 | +/** Minter represents the minting state. */ |
| 8 | +export interface Minter { |
| 9 | + /** current annual inflation rate */ |
| 10 | + inflation: string; |
| 11 | + /** current annual expected provisions */ |
| 12 | + annualProvisions: string; |
| 13 | +} |
| 14 | + |
| 15 | +/** Params holds parameters for the mint module. */ |
| 16 | +export interface Params { |
| 17 | + /** type of coin to mint */ |
| 18 | + mintDenom: string; |
| 19 | + /** maximum annual change in inflation rate */ |
| 20 | + inflationRateChange: string; |
| 21 | + /** maximum inflation rate */ |
| 22 | + inflationMax: string; |
| 23 | + /** minimum inflation rate */ |
| 24 | + inflationMin: string; |
| 25 | + /** goal of percent bonded atoms */ |
| 26 | + goalBonded: string; |
| 27 | + /** expected blocks per year */ |
| 28 | + blocksPerYear: Long; |
| 29 | +} |
| 30 | + |
| 31 | +const baseMinter: object = { inflation: '', annualProvisions: '' }; |
| 32 | + |
| 33 | +export const Minter = { |
| 34 | + encode(message: Minter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { |
| 35 | + if (message.inflation !== '') { |
| 36 | + writer.uint32(10).string(message.inflation); |
| 37 | + } |
| 38 | + if (message.annualProvisions !== '') { |
| 39 | + writer.uint32(18).string(message.annualProvisions); |
| 40 | + } |
| 41 | + return writer; |
| 42 | + }, |
| 43 | + |
| 44 | + decode(input: _m0.Reader | Uint8Array, length?: number): Minter { |
| 45 | + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); |
| 46 | + let end = length === undefined ? reader.len : reader.pos + length; |
| 47 | + const message = { ...baseMinter } as Minter; |
| 48 | + while (reader.pos < end) { |
| 49 | + const tag = reader.uint32(); |
| 50 | + switch (tag >>> 3) { |
| 51 | + case 1: |
| 52 | + message.inflation = reader.string(); |
| 53 | + break; |
| 54 | + case 2: |
| 55 | + message.annualProvisions = reader.string(); |
| 56 | + break; |
| 57 | + default: |
| 58 | + reader.skipType(tag & 7); |
| 59 | + break; |
| 60 | + } |
| 61 | + } |
| 62 | + return message; |
| 63 | + }, |
| 64 | + |
| 65 | + fromJSON(object: any): Minter { |
| 66 | + const message = { ...baseMinter } as Minter; |
| 67 | + if (object.inflation !== undefined && object.inflation !== null) { |
| 68 | + message.inflation = String(object.inflation); |
| 69 | + } else { |
| 70 | + message.inflation = ''; |
| 71 | + } |
| 72 | + if (object.annualProvisions !== undefined && object.annualProvisions !== null) { |
| 73 | + message.annualProvisions = String(object.annualProvisions); |
| 74 | + } else { |
| 75 | + message.annualProvisions = ''; |
| 76 | + } |
| 77 | + return message; |
| 78 | + }, |
| 79 | + |
| 80 | + toJSON(message: Minter): unknown { |
| 81 | + const obj: any = {}; |
| 82 | + message.inflation !== undefined && (obj.inflation = message.inflation); |
| 83 | + message.annualProvisions !== undefined && (obj.annualProvisions = message.annualProvisions); |
| 84 | + return obj; |
| 85 | + }, |
| 86 | + |
| 87 | + fromPartial(object: DeepPartial<Minter>): Minter { |
| 88 | + const message = { ...baseMinter } as Minter; |
| 89 | + if (object.inflation !== undefined && object.inflation !== null) { |
| 90 | + message.inflation = object.inflation; |
| 91 | + } else { |
| 92 | + message.inflation = ''; |
| 93 | + } |
| 94 | + if (object.annualProvisions !== undefined && object.annualProvisions !== null) { |
| 95 | + message.annualProvisions = object.annualProvisions; |
| 96 | + } else { |
| 97 | + message.annualProvisions = ''; |
| 98 | + } |
| 99 | + return message; |
| 100 | + }, |
| 101 | +}; |
| 102 | + |
| 103 | +const baseParams: object = { mintDenom: '', inflationRateChange: '', inflationMax: '', inflationMin: '', goalBonded: '', blocksPerYear: Long.UZERO }; |
| 104 | + |
| 105 | +export const Params = { |
| 106 | + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { |
| 107 | + if (message.mintDenom !== '') { |
| 108 | + writer.uint32(10).string(message.mintDenom); |
| 109 | + } |
| 110 | + if (message.inflationRateChange !== '') { |
| 111 | + writer.uint32(18).string(message.inflationRateChange); |
| 112 | + } |
| 113 | + if (message.inflationMax !== '') { |
| 114 | + writer.uint32(26).string(message.inflationMax); |
| 115 | + } |
| 116 | + if (message.inflationMin !== '') { |
| 117 | + writer.uint32(34).string(message.inflationMin); |
| 118 | + } |
| 119 | + if (message.goalBonded !== '') { |
| 120 | + writer.uint32(42).string(message.goalBonded); |
| 121 | + } |
| 122 | + if (!message.blocksPerYear.isZero()) { |
| 123 | + writer.uint32(48).uint64(message.blocksPerYear); |
| 124 | + } |
| 125 | + return writer; |
| 126 | + }, |
| 127 | + |
| 128 | + decode(input: _m0.Reader | Uint8Array, length?: number): Params { |
| 129 | + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); |
| 130 | + let end = length === undefined ? reader.len : reader.pos + length; |
| 131 | + const message = { ...baseParams } as Params; |
| 132 | + while (reader.pos < end) { |
| 133 | + const tag = reader.uint32(); |
| 134 | + switch (tag >>> 3) { |
| 135 | + case 1: |
| 136 | + message.mintDenom = reader.string(); |
| 137 | + break; |
| 138 | + case 2: |
| 139 | + message.inflationRateChange = reader.string(); |
| 140 | + break; |
| 141 | + case 3: |
| 142 | + message.inflationMax = reader.string(); |
| 143 | + break; |
| 144 | + case 4: |
| 145 | + message.inflationMin = reader.string(); |
| 146 | + break; |
| 147 | + case 5: |
| 148 | + message.goalBonded = reader.string(); |
| 149 | + break; |
| 150 | + case 6: |
| 151 | + message.blocksPerYear = reader.uint64() as Long; |
| 152 | + break; |
| 153 | + default: |
| 154 | + reader.skipType(tag & 7); |
| 155 | + break; |
| 156 | + } |
| 157 | + } |
| 158 | + return message; |
| 159 | + }, |
| 160 | + |
| 161 | + fromJSON(object: any): Params { |
| 162 | + const message = { ...baseParams } as Params; |
| 163 | + if (object.mintDenom !== undefined && object.mintDenom !== null) { |
| 164 | + message.mintDenom = String(object.mintDenom); |
| 165 | + } else { |
| 166 | + message.mintDenom = ''; |
| 167 | + } |
| 168 | + if (object.inflationRateChange !== undefined && object.inflationRateChange !== null) { |
| 169 | + message.inflationRateChange = String(object.inflationRateChange); |
| 170 | + } else { |
| 171 | + message.inflationRateChange = ''; |
| 172 | + } |
| 173 | + if (object.inflationMax !== undefined && object.inflationMax !== null) { |
| 174 | + message.inflationMax = String(object.inflationMax); |
| 175 | + } else { |
| 176 | + message.inflationMax = ''; |
| 177 | + } |
| 178 | + if (object.inflationMin !== undefined && object.inflationMin !== null) { |
| 179 | + message.inflationMin = String(object.inflationMin); |
| 180 | + } else { |
| 181 | + message.inflationMin = ''; |
| 182 | + } |
| 183 | + if (object.goalBonded !== undefined && object.goalBonded !== null) { |
| 184 | + message.goalBonded = String(object.goalBonded); |
| 185 | + } else { |
| 186 | + message.goalBonded = ''; |
| 187 | + } |
| 188 | + if (object.blocksPerYear !== undefined && object.blocksPerYear !== null) { |
| 189 | + message.blocksPerYear = Long.fromString(object.blocksPerYear); |
| 190 | + } else { |
| 191 | + message.blocksPerYear = Long.UZERO; |
| 192 | + } |
| 193 | + return message; |
| 194 | + }, |
| 195 | + |
| 196 | + toJSON(message: Params): unknown { |
| 197 | + const obj: any = {}; |
| 198 | + message.mintDenom !== undefined && (obj.mintDenom = message.mintDenom); |
| 199 | + message.inflationRateChange !== undefined && (obj.inflationRateChange = message.inflationRateChange); |
| 200 | + message.inflationMax !== undefined && (obj.inflationMax = message.inflationMax); |
| 201 | + message.inflationMin !== undefined && (obj.inflationMin = message.inflationMin); |
| 202 | + message.goalBonded !== undefined && (obj.goalBonded = message.goalBonded); |
| 203 | + message.blocksPerYear !== undefined && (obj.blocksPerYear = (message.blocksPerYear || Long.UZERO).toString()); |
| 204 | + return obj; |
| 205 | + }, |
| 206 | + |
| 207 | + fromPartial(object: DeepPartial<Params>): Params { |
| 208 | + const message = { ...baseParams } as Params; |
| 209 | + if (object.mintDenom !== undefined && object.mintDenom !== null) { |
| 210 | + message.mintDenom = object.mintDenom; |
| 211 | + } else { |
| 212 | + message.mintDenom = ''; |
| 213 | + } |
| 214 | + if (object.inflationRateChange !== undefined && object.inflationRateChange !== null) { |
| 215 | + message.inflationRateChange = object.inflationRateChange; |
| 216 | + } else { |
| 217 | + message.inflationRateChange = ''; |
| 218 | + } |
| 219 | + if (object.inflationMax !== undefined && object.inflationMax !== null) { |
| 220 | + message.inflationMax = object.inflationMax; |
| 221 | + } else { |
| 222 | + message.inflationMax = ''; |
| 223 | + } |
| 224 | + if (object.inflationMin !== undefined && object.inflationMin !== null) { |
| 225 | + message.inflationMin = object.inflationMin; |
| 226 | + } else { |
| 227 | + message.inflationMin = ''; |
| 228 | + } |
| 229 | + if (object.goalBonded !== undefined && object.goalBonded !== null) { |
| 230 | + message.goalBonded = object.goalBonded; |
| 231 | + } else { |
| 232 | + message.goalBonded = ''; |
| 233 | + } |
| 234 | + if (object.blocksPerYear !== undefined && object.blocksPerYear !== null) { |
| 235 | + message.blocksPerYear = object.blocksPerYear as Long; |
| 236 | + } else { |
| 237 | + message.blocksPerYear = Long.UZERO; |
| 238 | + } |
| 239 | + return message; |
| 240 | + }, |
| 241 | +}; |
| 242 | + |
| 243 | +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; |
| 244 | +export type DeepPartial<T> = T extends Builtin |
| 245 | + ? T |
| 246 | + : T extends Array<infer U> |
| 247 | + ? Array<DeepPartial<U>> |
| 248 | + : T extends ReadonlyArray<infer U> |
| 249 | + ? ReadonlyArray<DeepPartial<U>> |
| 250 | + : T extends {} |
| 251 | + ? { [K in keyof T]?: DeepPartial<T[K]> } |
| 252 | + : Partial<T>; |
| 253 | + |
| 254 | +if (_m0.util.Long !== Long) { |
| 255 | + _m0.util.Long = Long as any; |
| 256 | + _m0.configure(); |
| 257 | +} |
0 commit comments