import { Coin, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, Long } from "../../helpers"; /** * SuperfluidAssetType indicates whether the superfluid asset is * a native token itself or the lp share of a pool. */ export enum SuperfluidAssetType { SuperfluidAssetTypeNative = 0, SuperfluidAssetTypeLPShare = 1, UNRECOGNIZED = -1, } /** * SuperfluidAssetType indicates whether the superfluid asset is * a native token itself or the lp share of a pool. */ export enum SuperfluidAssetTypeSDKType { SuperfluidAssetTypeNative = 0, SuperfluidAssetTypeLPShare = 1, UNRECOGNIZED = -1, } export function superfluidAssetTypeFromJSON(object: any): SuperfluidAssetType { switch (object) { case 0: case "SuperfluidAssetTypeNative": return SuperfluidAssetType.SuperfluidAssetTypeNative; case 1: case "SuperfluidAssetTypeLPShare": return SuperfluidAssetType.SuperfluidAssetTypeLPShare; case -1: case "UNRECOGNIZED": default: return SuperfluidAssetType.UNRECOGNIZED; } } export function superfluidAssetTypeToJSON(object: SuperfluidAssetType): string { switch (object) { case SuperfluidAssetType.SuperfluidAssetTypeNative: return "SuperfluidAssetTypeNative"; case SuperfluidAssetType.SuperfluidAssetTypeLPShare: return "SuperfluidAssetTypeLPShare"; case SuperfluidAssetType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } /** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ export interface SuperfluidAsset { denom: string; /** * AssetType indicates whether the superfluid asset is a native token or an lp * share */ assetType: SuperfluidAssetType; } /** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ export interface SuperfluidAssetSDKType { denom: string; /** * AssetType indicates whether the superfluid asset is a native token or an lp * share */ asset_type: SuperfluidAssetTypeSDKType; } /** * SuperfluidIntermediaryAccount takes the role of intermediary between LP token * and OSMO tokens for superfluid staking. The intermediary account is the * actual account responsible for delegation, not the validator account itself. */ export interface SuperfluidIntermediaryAccount { /** Denom indicates the denom of the superfluid asset. */ denom: string; valAddr: string; /** perpetual gauge for rewards distribution */ gaugeId: Long; } /** * SuperfluidIntermediaryAccount takes the role of intermediary between LP token * and OSMO tokens for superfluid staking. The intermediary account is the * actual account responsible for delegation, not the validator account itself. */ export interface SuperfluidIntermediaryAccountSDKType { /** Denom indicates the denom of the superfluid asset. */ denom: string; val_addr: string; /** perpetual gauge for rewards distribution */ gauge_id: Long; } /** * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we * treat an LP share as having, for all of epoch N. Eventually this is intended * to be set as the Time-weighted-average-osmo-backing for the entire duration * of epoch N-1. (Thereby locking whats in use for epoch N as based on the prior * epochs rewards) However for now, this is not the TWAP but instead the spot * price at the boundary. For different types of assets in the future, it could * change. */ export interface OsmoEquivalentMultiplierRecord { epochNumber: Long; /** superfluid asset denom, can be LP token or native token */ denom: string; multiplier: string; } /** * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we * treat an LP share as having, for all of epoch N. Eventually this is intended * to be set as the Time-weighted-average-osmo-backing for the entire duration * of epoch N-1. (Thereby locking whats in use for epoch N as based on the prior * epochs rewards) However for now, this is not the TWAP but instead the spot * price at the boundary. For different types of assets in the future, it could * change. */ export interface OsmoEquivalentMultiplierRecordSDKType { epoch_number: Long; /** superfluid asset denom, can be LP token or native token */ denom: string; multiplier: string; } /** * SuperfluidDelegationRecord is a struct used to indicate superfluid * delegations of an account in the state machine in a user friendly form. */ export interface SuperfluidDelegationRecord { delegatorAddress: string; validatorAddress: string; delegationAmount?: Coin; equivalentStakedAmount?: Coin; } /** * SuperfluidDelegationRecord is a struct used to indicate superfluid * delegations of an account in the state machine in a user friendly form. */ export interface SuperfluidDelegationRecordSDKType { delegator_address: string; validator_address: string; delegation_amount?: CoinSDKType; equivalent_staked_amount?: CoinSDKType; } /** * LockIdIntermediaryAccountConnection is a struct used to indicate the * relationship between the underlying lock id and superfluid delegation done * via lp shares. */ export interface LockIdIntermediaryAccountConnection { lockId: Long; intermediaryAccount: string; } /** * LockIdIntermediaryAccountConnection is a struct used to indicate the * relationship between the underlying lock id and superfluid delegation done * via lp shares. */ export interface LockIdIntermediaryAccountConnectionSDKType { lock_id: Long; intermediary_account: string; } export interface UnpoolWhitelistedPools { ids: Long[]; } export interface UnpoolWhitelistedPoolsSDKType { ids: Long[]; } function createBaseSuperfluidAsset(): SuperfluidAsset { return { denom: "", assetType: 0 }; } export const SuperfluidAsset = { encode(message: SuperfluidAsset, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } if (message.assetType !== 0) { writer.uint32(16).int32(message.assetType); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): SuperfluidAsset { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSuperfluidAsset(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.denom = reader.string(); break; case 2: message.assetType = (reader.int32() as any); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): SuperfluidAsset { const message = createBaseSuperfluidAsset(); message.denom = object.denom ?? ""; message.assetType = object.assetType ?? 0; return message; } }; function createBaseSuperfluidIntermediaryAccount(): SuperfluidIntermediaryAccount { return { denom: "", valAddr: "", gaugeId: Long.UZERO }; } export const SuperfluidIntermediaryAccount = { encode(message: SuperfluidIntermediaryAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.denom !== "") { writer.uint32(10).string(message.denom); } if (message.valAddr !== "") { writer.uint32(18).string(message.valAddr); } if (!message.gaugeId.isZero()) { writer.uint32(24).uint64(message.gaugeId); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): SuperfluidIntermediaryAccount { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSuperfluidIntermediaryAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.denom = reader.string(); break; case 2: message.valAddr = reader.string(); break; case 3: message.gaugeId = (reader.uint64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): SuperfluidIntermediaryAccount { const message = createBaseSuperfluidIntermediaryAccount(); message.denom = object.denom ?? ""; message.valAddr = object.valAddr ?? ""; message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? Long.fromValue(object.gaugeId) : Long.UZERO; return message; } }; function createBaseOsmoEquivalentMultiplierRecord(): OsmoEquivalentMultiplierRecord { return { epochNumber: Long.ZERO, denom: "", multiplier: "" }; } export const OsmoEquivalentMultiplierRecord = { encode(message: OsmoEquivalentMultiplierRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.epochNumber.isZero()) { writer.uint32(8).int64(message.epochNumber); } if (message.denom !== "") { writer.uint32(18).string(message.denom); } if (message.multiplier !== "") { writer.uint32(26).string(message.multiplier); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): OsmoEquivalentMultiplierRecord { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOsmoEquivalentMultiplierRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.epochNumber = (reader.int64() as Long); break; case 2: message.denom = reader.string(); break; case 3: message.multiplier = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): OsmoEquivalentMultiplierRecord { const message = createBaseOsmoEquivalentMultiplierRecord(); message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? Long.fromValue(object.epochNumber) : Long.ZERO; message.denom = object.denom ?? ""; message.multiplier = object.multiplier ?? ""; return message; } }; function createBaseSuperfluidDelegationRecord(): SuperfluidDelegationRecord { return { delegatorAddress: "", validatorAddress: "", delegationAmount: undefined, equivalentStakedAmount: undefined }; } export const SuperfluidDelegationRecord = { encode(message: SuperfluidDelegationRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } if (message.validatorAddress !== "") { writer.uint32(18).string(message.validatorAddress); } if (message.delegationAmount !== undefined) { Coin.encode(message.delegationAmount, writer.uint32(26).fork()).ldelim(); } if (message.equivalentStakedAmount !== undefined) { Coin.encode(message.equivalentStakedAmount, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): SuperfluidDelegationRecord { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSuperfluidDelegationRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.delegatorAddress = reader.string(); break; case 2: message.validatorAddress = reader.string(); break; case 3: message.delegationAmount = Coin.decode(reader, reader.uint32()); break; case 4: message.equivalentStakedAmount = Coin.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): SuperfluidDelegationRecord { const message = createBaseSuperfluidDelegationRecord(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; message.delegationAmount = object.delegationAmount !== undefined && object.delegationAmount !== null ? Coin.fromPartial(object.delegationAmount) : undefined; message.equivalentStakedAmount = object.equivalentStakedAmount !== undefined && object.equivalentStakedAmount !== null ? Coin.fromPartial(object.equivalentStakedAmount) : undefined; return message; } }; function createBaseLockIdIntermediaryAccountConnection(): LockIdIntermediaryAccountConnection { return { lockId: Long.UZERO, intermediaryAccount: "" }; } export const LockIdIntermediaryAccountConnection = { encode(message: LockIdIntermediaryAccountConnection, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.lockId.isZero()) { writer.uint32(8).uint64(message.lockId); } if (message.intermediaryAccount !== "") { writer.uint32(18).string(message.intermediaryAccount); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): LockIdIntermediaryAccountConnection { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLockIdIntermediaryAccountConnection(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.lockId = (reader.uint64() as Long); break; case 2: message.intermediaryAccount = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): LockIdIntermediaryAccountConnection { const message = createBaseLockIdIntermediaryAccountConnection(); message.lockId = object.lockId !== undefined && object.lockId !== null ? Long.fromValue(object.lockId) : Long.UZERO; message.intermediaryAccount = object.intermediaryAccount ?? ""; return message; } }; function createBaseUnpoolWhitelistedPools(): UnpoolWhitelistedPools { return { ids: [] }; } export const UnpoolWhitelistedPools = { encode(message: UnpoolWhitelistedPools, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { writer.uint32(10).fork(); for (const v of message.ids) { writer.uint64(v); } writer.ldelim(); return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): UnpoolWhitelistedPools { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUnpoolWhitelistedPools(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { message.ids.push((reader.uint64() as Long)); } } else { message.ids.push((reader.uint64() as Long)); } break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): UnpoolWhitelistedPools { const message = createBaseUnpoolWhitelistedPools(); message.ids = object.ids?.map(e => Long.fromValue(e)) || []; return message; } };