import { Duration, DurationSDKType } from "../../../google/protobuf/duration"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, Long } from "../../../helpers"; export interface Params { /** * minted_denom is the denomination of the coin expected to be minted by the * minting module. Pool-incentives module doesn’t actually mint the coin * itself, but rather manages the distribution of coins that matches the * defined minted_denom. */ mintedDenom: string; } export interface ParamsSDKType { /** * minted_denom is the denomination of the coin expected to be minted by the * minting module. Pool-incentives module doesn’t actually mint the coin * itself, but rather manages the distribution of coins that matches the * defined minted_denom. */ minted_denom: string; } export interface LockableDurationsInfo { lockableDurations: Duration[]; } export interface LockableDurationsInfoSDKType { lockable_durations: DurationSDKType[]; } export interface DistrInfo { totalWeight: string; records: DistrRecord[]; } export interface DistrInfoSDKType { total_weight: string; records: DistrRecordSDKType[]; } export interface DistrRecord { gaugeId: Long; weight: string; } export interface DistrRecordSDKType { gauge_id: Long; weight: string; } export interface PoolToGauge { poolId: Long; gaugeId: Long; duration?: Duration; } export interface PoolToGaugeSDKType { pool_id: Long; gauge_id: Long; duration?: DurationSDKType; } export interface PoolToGauges { poolToGauge: PoolToGauge[]; } export interface PoolToGaugesSDKType { pool_to_gauge: PoolToGaugeSDKType[]; } function createBaseParams(): Params { return { mintedDenom: "" }; } export const Params = { encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.mintedDenom !== "") { writer.uint32(10).string(message.mintedDenom); } 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.mintedDenom = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): Params { const message = createBaseParams(); message.mintedDenom = object.mintedDenom ?? ""; return message; } }; function createBaseLockableDurationsInfo(): LockableDurationsInfo { return { lockableDurations: [] }; } export const LockableDurationsInfo = { encode(message: LockableDurationsInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.lockableDurations) { Duration.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): LockableDurationsInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLockableDurationsInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.lockableDurations.push(Duration.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): LockableDurationsInfo { const message = createBaseLockableDurationsInfo(); message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; return message; } }; function createBaseDistrInfo(): DistrInfo { return { totalWeight: "", records: [] }; } export const DistrInfo = { encode(message: DistrInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.totalWeight !== "") { writer.uint32(10).string(message.totalWeight); } for (const v of message.records) { DistrRecord.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): DistrInfo { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDistrInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.totalWeight = reader.string(); break; case 2: message.records.push(DistrRecord.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): DistrInfo { const message = createBaseDistrInfo(); message.totalWeight = object.totalWeight ?? ""; message.records = object.records?.map(e => DistrRecord.fromPartial(e)) || []; return message; } }; function createBaseDistrRecord(): DistrRecord { return { gaugeId: Long.UZERO, weight: "" }; } export const DistrRecord = { encode(message: DistrRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.gaugeId.isZero()) { writer.uint32(8).uint64(message.gaugeId); } if (message.weight !== "") { writer.uint32(18).string(message.weight); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): DistrRecord { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDistrRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.gaugeId = (reader.uint64() as Long); break; case 2: message.weight = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): DistrRecord { const message = createBaseDistrRecord(); message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? Long.fromValue(object.gaugeId) : Long.UZERO; message.weight = object.weight ?? ""; return message; } }; function createBasePoolToGauge(): PoolToGauge { return { poolId: Long.UZERO, gaugeId: Long.UZERO, duration: undefined }; } export const PoolToGauge = { encode(message: PoolToGauge, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.poolId.isZero()) { writer.uint32(8).uint64(message.poolId); } if (!message.gaugeId.isZero()) { writer.uint32(16).uint64(message.gaugeId); } if (message.duration !== undefined) { Duration.encode(message.duration, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): PoolToGauge { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePoolToGauge(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.poolId = (reader.uint64() as Long); break; case 2: message.gaugeId = (reader.uint64() as Long); break; case 3: message.duration = Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): PoolToGauge { const message = createBasePoolToGauge(); message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? Long.fromValue(object.gaugeId) : Long.UZERO; message.duration = object.duration !== undefined && object.duration !== null ? Duration.fromPartial(object.duration) : undefined; return message; } }; function createBasePoolToGauges(): PoolToGauges { return { poolToGauge: [] }; } export const PoolToGauges = { encode(message: PoolToGauges, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.poolToGauge) { PoolToGauge.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): PoolToGauges { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePoolToGauges(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: message.poolToGauge.push(PoolToGauge.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): PoolToGauges { const message = createBasePoolToGauges(); message.poolToGauge = object.poolToGauge?.map(e => PoolToGauge.fromPartial(e)) || []; return message; } };