diff --git a/packages/types/protobuf/codegen/OmniFlix/bundle.ts b/packages/types/protobuf/codegen/OmniFlix/bundle.ts index 5eac9c48f..77f9fc93e 100644 --- a/packages/types/protobuf/codegen/OmniFlix/bundle.ts +++ b/packages/types/protobuf/codegen/OmniFlix/bundle.ts @@ -1,30 +1,30 @@ -import * as _219 from "./onft/v1beta1/genesis"; -import * as _220 from "./onft/v1beta1/onft"; -import * as _221 from "./onft/v1beta1/params"; -import * as _222 from "./onft/v1beta1/query"; -import * as _223 from "./onft/v1beta1/tx"; -import * as _544 from "./onft/v1beta1/tx.amino"; -import * as _545 from "./onft/v1beta1/tx.registry"; -import * as _546 from "./onft/v1beta1/query.rpc.Query"; -import * as _547 from "./onft/v1beta1/tx.rpc.msg"; -import * as _692 from "./rpc.query"; -import * as _693 from "./rpc.tx"; +import * as _220 from "./onft/v1beta1/genesis"; +import * as _221 from "./onft/v1beta1/onft"; +import * as _222 from "./onft/v1beta1/params"; +import * as _223 from "./onft/v1beta1/query"; +import * as _224 from "./onft/v1beta1/tx"; +import * as _558 from "./onft/v1beta1/tx.amino"; +import * as _559 from "./onft/v1beta1/tx.registry"; +import * as _560 from "./onft/v1beta1/query.rpc.Query"; +import * as _561 from "./onft/v1beta1/tx.rpc.msg"; +import * as _710 from "./rpc.query"; +import * as _711 from "./rpc.tx"; export namespace OmniFlix { export namespace onft { export const v1beta1 = { - ..._219, ..._220, ..._221, ..._222, ..._223, - ..._544, - ..._545, - ..._546, - ..._547 + ..._224, + ..._558, + ..._559, + ..._560, + ..._561 }; } export const ClientFactory = { - ..._692, - ..._693 + ..._710, + ..._711 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/bundle.ts b/packages/types/protobuf/codegen/Switcheo/bundle.ts new file mode 100644 index 000000000..d651d45e1 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/bundle.ts @@ -0,0 +1,46 @@ +import * as _384 from "./carbon/cdp/asset_params"; +import * as _385 from "./carbon/cdp/cdp_liquidations"; +import * as _386 from "./carbon/cdp/debt_info"; +import * as _387 from "./carbon/cdp/e_mode_category"; +import * as _388 from "./carbon/cdp/event"; +import * as _389 from "./carbon/cdp/genesis"; +import * as _390 from "./carbon/cdp/params"; +import * as _391 from "./carbon/cdp/query"; +import * as _392 from "./carbon/cdp/rate_strategy_params"; +import * as _393 from "./carbon/cdp/reward_scheme"; +import * as _394 from "./carbon/cdp/stablecoin_debt_info"; +import * as _395 from "./carbon/cdp/stablecoin_interest_info"; +import * as _396 from "./carbon/cdp/tx"; +import * as _681 from "./carbon/cdp/tx.amino"; +import * as _682 from "./carbon/cdp/tx.registry"; +import * as _683 from "./carbon/cdp/query.rpc.Query"; +import * as _684 from "./carbon/cdp/tx.rpc.msg"; +import * as _722 from "./rpc.query"; +import * as _723 from "./rpc.tx"; +export namespace Switcheo { + export namespace carbon { + export const cdp = { + ..._384, + ..._385, + ..._386, + ..._387, + ..._388, + ..._389, + ..._390, + ..._391, + ..._392, + ..._393, + ..._394, + ..._395, + ..._396, + ..._681, + ..._682, + ..._683, + ..._684 + }; + } + export const ClientFactory = { + ..._722, + ..._723 + }; +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/asset_params.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/asset_params.ts new file mode 100644 index 000000000..b8dff7602 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/asset_params.ts @@ -0,0 +1,593 @@ +import { StringValue, StringValueAmino, StringValueSDKType, BoolValue, BoolValueAmino, BoolValueSDKType } from "../../../google/protobuf/wrappers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +export interface AssetParamsAPI { + assetParams?: AssetParams | undefined; + tokenName: string; +} +export interface AssetParamsAPIProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.AssetParamsAPI"; + value: Uint8Array; +} +export interface AssetParamsAPIAmino { + asset_params?: AssetParamsAmino | undefined; + token_name?: string; +} +export interface AssetParamsAPIAminoMsg { + type: "/Switcheo.carbon.cdp.AssetParamsAPI"; + value: AssetParamsAPIAmino; +} +export interface AssetParamsAPISDKType { + asset_params?: AssetParamsSDKType | undefined; + token_name: string; +} +export interface AssetParams { + denom: string; + rateStrategyName: string; + allowRepayStablecoinInterest: boolean; + loanToValue?: string; + liquidationThreshold?: string; + liquidationDiscount?: string; + supplyCap?: string; + borrowCap?: string; +} +export interface AssetParamsProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.AssetParams"; + value: Uint8Array; +} +export interface AssetParamsAmino { + denom?: string; + rate_strategy_name?: string; + allow_repay_stablecoin_interest?: boolean; + loan_to_value?: string; + liquidation_threshold?: string; + liquidation_discount?: string; + supply_cap?: string; + borrow_cap?: string; +} +export interface AssetParamsAminoMsg { + type: "/Switcheo.carbon.cdp.AssetParams"; + value: AssetParamsAmino; +} +export interface AssetParamsSDKType { + denom: string; + rate_strategy_name: string; + allow_repay_stablecoin_interest: boolean; + loan_to_value?: string; + liquidation_threshold?: string; + liquidation_discount?: string; + supply_cap?: string; + borrow_cap?: string; +} +export interface AssetUtilization { + denom: string; + totalBorrowed?: string; + totalAmount?: string; + utilizationRate?: string; +} +export interface AssetUtilizationProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.AssetUtilization"; + value: Uint8Array; +} +export interface AssetUtilizationAmino { + denom?: string; + total_borrowed?: string; + total_amount?: string; + utilization_rate?: string; +} +export interface AssetUtilizationAminoMsg { + type: "/Switcheo.carbon.cdp.AssetUtilization"; + value: AssetUtilizationAmino; +} +export interface AssetUtilizationSDKType { + denom: string; + total_borrowed?: string; + total_amount?: string; + utilization_rate?: string; +} +export interface UpdateAssetParams { + denom: string; + rateStrategyName?: StringValue | undefined; + allowRepayStablecoinInterest?: BoolValue | undefined; + loanToValue?: string; + liquidationThreshold?: string; + liquidationDiscount?: string; + supplyCap?: string; + borrowCap?: string; +} +export interface UpdateAssetParamsProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.UpdateAssetParams"; + value: Uint8Array; +} +export interface UpdateAssetParamsAmino { + denom?: string; + rate_strategy_name?: StringValueAmino | undefined; + allow_repay_stablecoin_interest?: BoolValueAmino | undefined; + loan_to_value?: string; + liquidation_threshold?: string; + liquidation_discount?: string; + supply_cap?: string; + borrow_cap?: string; +} +export interface UpdateAssetParamsAminoMsg { + type: "/Switcheo.carbon.cdp.UpdateAssetParams"; + value: UpdateAssetParamsAmino; +} +export interface UpdateAssetParamsSDKType { + denom: string; + rate_strategy_name?: StringValueSDKType | undefined; + allow_repay_stablecoin_interest?: BoolValueSDKType | undefined; + loan_to_value?: string; + liquidation_threshold?: string; + liquidation_discount?: string; + supply_cap?: string; + borrow_cap?: string; +} +function createBaseAssetParamsAPI(): AssetParamsAPI { + return { + assetParams: undefined, + tokenName: "" + }; +} +export const AssetParamsAPI = { + typeUrl: "/Switcheo.carbon.cdp.AssetParamsAPI", + encode(message: AssetParamsAPI, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetParams !== undefined) { + AssetParams.encode(message.assetParams, writer.uint32(10).fork()).ldelim(); + } + if (message.tokenName !== "") { + writer.uint32(18).string(message.tokenName); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AssetParamsAPI { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAssetParamsAPI(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetParams = AssetParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.tokenName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AssetParamsAPI { + const message = createBaseAssetParamsAPI(); + message.assetParams = object.assetParams !== undefined && object.assetParams !== null ? AssetParams.fromPartial(object.assetParams) : undefined; + message.tokenName = object.tokenName ?? ""; + return message; + }, + fromAmino(object: AssetParamsAPIAmino): AssetParamsAPI { + const message = createBaseAssetParamsAPI(); + if (object.asset_params !== undefined && object.asset_params !== null) { + message.assetParams = AssetParams.fromAmino(object.asset_params); + } + if (object.token_name !== undefined && object.token_name !== null) { + message.tokenName = object.token_name; + } + return message; + }, + toAmino(message: AssetParamsAPI, useInterfaces: boolean = false): AssetParamsAPIAmino { + const obj: any = {}; + obj.asset_params = message.assetParams ? AssetParams.toAmino(message.assetParams, useInterfaces) : undefined; + obj.token_name = message.tokenName === "" ? undefined : message.tokenName; + return obj; + }, + fromAminoMsg(object: AssetParamsAPIAminoMsg): AssetParamsAPI { + return AssetParamsAPI.fromAmino(object.value); + }, + fromProtoMsg(message: AssetParamsAPIProtoMsg, useInterfaces: boolean = false): AssetParamsAPI { + return AssetParamsAPI.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AssetParamsAPI): Uint8Array { + return AssetParamsAPI.encode(message).finish(); + }, + toProtoMsg(message: AssetParamsAPI): AssetParamsAPIProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.AssetParamsAPI", + value: AssetParamsAPI.encode(message).finish() + }; + } +}; +function createBaseAssetParams(): AssetParams { + return { + denom: "", + rateStrategyName: "", + allowRepayStablecoinInterest: false, + loanToValue: undefined, + liquidationThreshold: undefined, + liquidationDiscount: undefined, + supplyCap: undefined, + borrowCap: undefined + }; +} +export const AssetParams = { + typeUrl: "/Switcheo.carbon.cdp.AssetParams", + encode(message: AssetParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.rateStrategyName !== "") { + writer.uint32(26).string(message.rateStrategyName); + } + if (message.allowRepayStablecoinInterest === true) { + writer.uint32(32).bool(message.allowRepayStablecoinInterest); + } + if (message.loanToValue !== undefined) { + writer.uint32(42).string(message.loanToValue); + } + if (message.liquidationThreshold !== undefined) { + writer.uint32(50).string(message.liquidationThreshold); + } + if (message.liquidationDiscount !== undefined) { + writer.uint32(58).string(message.liquidationDiscount); + } + if (message.supplyCap !== undefined) { + writer.uint32(66).string(message.supplyCap); + } + if (message.borrowCap !== undefined) { + writer.uint32(74).string(message.borrowCap); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AssetParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAssetParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 3: + message.rateStrategyName = reader.string(); + break; + case 4: + message.allowRepayStablecoinInterest = reader.bool(); + break; + case 5: + message.loanToValue = reader.string(); + break; + case 6: + message.liquidationThreshold = reader.string(); + break; + case 7: + message.liquidationDiscount = reader.string(); + break; + case 8: + message.supplyCap = reader.string(); + break; + case 9: + message.borrowCap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AssetParams { + const message = createBaseAssetParams(); + message.denom = object.denom ?? ""; + message.rateStrategyName = object.rateStrategyName ?? ""; + message.allowRepayStablecoinInterest = object.allowRepayStablecoinInterest ?? false; + message.loanToValue = object.loanToValue ?? undefined; + message.liquidationThreshold = object.liquidationThreshold ?? undefined; + message.liquidationDiscount = object.liquidationDiscount ?? undefined; + message.supplyCap = object.supplyCap ?? undefined; + message.borrowCap = object.borrowCap ?? undefined; + return message; + }, + fromAmino(object: AssetParamsAmino): AssetParams { + const message = createBaseAssetParams(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.rate_strategy_name !== undefined && object.rate_strategy_name !== null) { + message.rateStrategyName = object.rate_strategy_name; + } + if (object.allow_repay_stablecoin_interest !== undefined && object.allow_repay_stablecoin_interest !== null) { + message.allowRepayStablecoinInterest = object.allow_repay_stablecoin_interest; + } + if (object.loan_to_value !== undefined && object.loan_to_value !== null) { + message.loanToValue = object.loan_to_value; + } + if (object.liquidation_threshold !== undefined && object.liquidation_threshold !== null) { + message.liquidationThreshold = object.liquidation_threshold; + } + if (object.liquidation_discount !== undefined && object.liquidation_discount !== null) { + message.liquidationDiscount = object.liquidation_discount; + } + if (object.supply_cap !== undefined && object.supply_cap !== null) { + message.supplyCap = object.supply_cap; + } + if (object.borrow_cap !== undefined && object.borrow_cap !== null) { + message.borrowCap = object.borrow_cap; + } + return message; + }, + toAmino(message: AssetParams, useInterfaces: boolean = false): AssetParamsAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.rate_strategy_name = message.rateStrategyName === "" ? undefined : message.rateStrategyName; + obj.allow_repay_stablecoin_interest = message.allowRepayStablecoinInterest === false ? undefined : message.allowRepayStablecoinInterest; + obj.loan_to_value = message.loanToValue === null ? undefined : message.loanToValue; + obj.liquidation_threshold = message.liquidationThreshold === null ? undefined : message.liquidationThreshold; + obj.liquidation_discount = message.liquidationDiscount === null ? undefined : message.liquidationDiscount; + obj.supply_cap = message.supplyCap === null ? undefined : message.supplyCap; + obj.borrow_cap = message.borrowCap === null ? undefined : message.borrowCap; + return obj; + }, + fromAminoMsg(object: AssetParamsAminoMsg): AssetParams { + return AssetParams.fromAmino(object.value); + }, + fromProtoMsg(message: AssetParamsProtoMsg, useInterfaces: boolean = false): AssetParams { + return AssetParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AssetParams): Uint8Array { + return AssetParams.encode(message).finish(); + }, + toProtoMsg(message: AssetParams): AssetParamsProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.AssetParams", + value: AssetParams.encode(message).finish() + }; + } +}; +function createBaseAssetUtilization(): AssetUtilization { + return { + denom: "", + totalBorrowed: undefined, + totalAmount: undefined, + utilizationRate: undefined + }; +} +export const AssetUtilization = { + typeUrl: "/Switcheo.carbon.cdp.AssetUtilization", + encode(message: AssetUtilization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.totalBorrowed !== undefined) { + writer.uint32(18).string(message.totalBorrowed); + } + if (message.totalAmount !== undefined) { + writer.uint32(26).string(message.totalAmount); + } + if (message.utilizationRate !== undefined) { + writer.uint32(34).string(Decimal.fromUserInput(message.utilizationRate, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AssetUtilization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAssetUtilization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.totalBorrowed = reader.string(); + break; + case 3: + message.totalAmount = reader.string(); + break; + case 4: + message.utilizationRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AssetUtilization { + const message = createBaseAssetUtilization(); + message.denom = object.denom ?? ""; + message.totalBorrowed = object.totalBorrowed ?? undefined; + message.totalAmount = object.totalAmount ?? undefined; + message.utilizationRate = object.utilizationRate ?? undefined; + return message; + }, + fromAmino(object: AssetUtilizationAmino): AssetUtilization { + const message = createBaseAssetUtilization(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.total_borrowed !== undefined && object.total_borrowed !== null) { + message.totalBorrowed = object.total_borrowed; + } + if (object.total_amount !== undefined && object.total_amount !== null) { + message.totalAmount = object.total_amount; + } + if (object.utilization_rate !== undefined && object.utilization_rate !== null) { + message.utilizationRate = object.utilization_rate; + } + return message; + }, + toAmino(message: AssetUtilization, useInterfaces: boolean = false): AssetUtilizationAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.total_borrowed = message.totalBorrowed === null ? undefined : message.totalBorrowed; + obj.total_amount = message.totalAmount === null ? undefined : message.totalAmount; + obj.utilization_rate = message.utilizationRate === null ? undefined : message.utilizationRate; + return obj; + }, + fromAminoMsg(object: AssetUtilizationAminoMsg): AssetUtilization { + return AssetUtilization.fromAmino(object.value); + }, + fromProtoMsg(message: AssetUtilizationProtoMsg, useInterfaces: boolean = false): AssetUtilization { + return AssetUtilization.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AssetUtilization): Uint8Array { + return AssetUtilization.encode(message).finish(); + }, + toProtoMsg(message: AssetUtilization): AssetUtilizationProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.AssetUtilization", + value: AssetUtilization.encode(message).finish() + }; + } +}; +function createBaseUpdateAssetParams(): UpdateAssetParams { + return { + denom: "", + rateStrategyName: undefined, + allowRepayStablecoinInterest: undefined, + loanToValue: undefined, + liquidationThreshold: undefined, + liquidationDiscount: undefined, + supplyCap: undefined, + borrowCap: undefined + }; +} +export const UpdateAssetParams = { + typeUrl: "/Switcheo.carbon.cdp.UpdateAssetParams", + encode(message: UpdateAssetParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.rateStrategyName !== undefined) { + StringValue.encode(message.rateStrategyName, writer.uint32(18).fork()).ldelim(); + } + if (message.allowRepayStablecoinInterest !== undefined) { + BoolValue.encode(message.allowRepayStablecoinInterest, writer.uint32(26).fork()).ldelim(); + } + if (message.loanToValue !== undefined) { + writer.uint32(34).string(message.loanToValue); + } + if (message.liquidationThreshold !== undefined) { + writer.uint32(42).string(message.liquidationThreshold); + } + if (message.liquidationDiscount !== undefined) { + writer.uint32(50).string(message.liquidationDiscount); + } + if (message.supplyCap !== undefined) { + writer.uint32(58).string(message.supplyCap); + } + if (message.borrowCap !== undefined) { + writer.uint32(66).string(message.borrowCap); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UpdateAssetParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateAssetParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.rateStrategyName = StringValue.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.allowRepayStablecoinInterest = BoolValue.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.loanToValue = reader.string(); + break; + case 5: + message.liquidationThreshold = reader.string(); + break; + case 6: + message.liquidationDiscount = reader.string(); + break; + case 7: + message.supplyCap = reader.string(); + break; + case 8: + message.borrowCap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateAssetParams { + const message = createBaseUpdateAssetParams(); + message.denom = object.denom ?? ""; + message.rateStrategyName = object.rateStrategyName !== undefined && object.rateStrategyName !== null ? StringValue.fromPartial(object.rateStrategyName) : undefined; + message.allowRepayStablecoinInterest = object.allowRepayStablecoinInterest !== undefined && object.allowRepayStablecoinInterest !== null ? BoolValue.fromPartial(object.allowRepayStablecoinInterest) : undefined; + message.loanToValue = object.loanToValue ?? undefined; + message.liquidationThreshold = object.liquidationThreshold ?? undefined; + message.liquidationDiscount = object.liquidationDiscount ?? undefined; + message.supplyCap = object.supplyCap ?? undefined; + message.borrowCap = object.borrowCap ?? undefined; + return message; + }, + fromAmino(object: UpdateAssetParamsAmino): UpdateAssetParams { + const message = createBaseUpdateAssetParams(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.rate_strategy_name !== undefined && object.rate_strategy_name !== null) { + message.rateStrategyName = StringValue.fromAmino(object.rate_strategy_name); + } + if (object.allow_repay_stablecoin_interest !== undefined && object.allow_repay_stablecoin_interest !== null) { + message.allowRepayStablecoinInterest = BoolValue.fromAmino(object.allow_repay_stablecoin_interest); + } + if (object.loan_to_value !== undefined && object.loan_to_value !== null) { + message.loanToValue = object.loan_to_value; + } + if (object.liquidation_threshold !== undefined && object.liquidation_threshold !== null) { + message.liquidationThreshold = object.liquidation_threshold; + } + if (object.liquidation_discount !== undefined && object.liquidation_discount !== null) { + message.liquidationDiscount = object.liquidation_discount; + } + if (object.supply_cap !== undefined && object.supply_cap !== null) { + message.supplyCap = object.supply_cap; + } + if (object.borrow_cap !== undefined && object.borrow_cap !== null) { + message.borrowCap = object.borrow_cap; + } + return message; + }, + toAmino(message: UpdateAssetParams, useInterfaces: boolean = false): UpdateAssetParamsAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.rate_strategy_name = message.rateStrategyName ? StringValue.toAmino(message.rateStrategyName, useInterfaces) : undefined; + obj.allow_repay_stablecoin_interest = message.allowRepayStablecoinInterest ? BoolValue.toAmino(message.allowRepayStablecoinInterest, useInterfaces) : undefined; + obj.loan_to_value = message.loanToValue === null ? undefined : message.loanToValue; + obj.liquidation_threshold = message.liquidationThreshold === null ? undefined : message.liquidationThreshold; + obj.liquidation_discount = message.liquidationDiscount === null ? undefined : message.liquidationDiscount; + obj.supply_cap = message.supplyCap === null ? undefined : message.supplyCap; + obj.borrow_cap = message.borrowCap === null ? undefined : message.borrowCap; + return obj; + }, + fromAminoMsg(object: UpdateAssetParamsAminoMsg): UpdateAssetParams { + return UpdateAssetParams.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateAssetParamsProtoMsg, useInterfaces: boolean = false): UpdateAssetParams { + return UpdateAssetParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UpdateAssetParams): Uint8Array { + return UpdateAssetParams.encode(message).finish(); + }, + toProtoMsg(message: UpdateAssetParams): UpdateAssetParamsProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.UpdateAssetParams", + value: UpdateAssetParams.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/cdp_liquidations.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/cdp_liquidations.ts new file mode 100644 index 000000000..0fba07973 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/cdp_liquidations.ts @@ -0,0 +1,294 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +export interface CDPLiquidations { + id: bigint; + liquidator: string; + debtor: string; + collateralDenom: string; + collateralAmountLiquidated: string; + collateralAmountLiquidator: string; + collateralAmountFee: string; + liquidationPrice: string; + marketPrice: string; + discount: string; + debtDenom: string; + debtAmount: string; + blockHeight: bigint; + blockTime: Date | undefined; + transactionHash: string; +} +export interface CDPLiquidationsProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.CDPLiquidations"; + value: Uint8Array; +} +export interface CDPLiquidationsAmino { + id?: string; + liquidator?: string; + debtor?: string; + collateral_denom?: string; + collateral_amount_liquidated?: string; + collateral_amount_liquidator?: string; + collateral_amount_fee?: string; + liquidation_price?: string; + market_price?: string; + discount?: string; + debt_denom?: string; + debt_amount?: string; + block_height?: string; + block_time?: string | undefined; + transaction_hash?: string; +} +export interface CDPLiquidationsAminoMsg { + type: "/Switcheo.carbon.cdp.CDPLiquidations"; + value: CDPLiquidationsAmino; +} +export interface CDPLiquidationsSDKType { + id: bigint; + liquidator: string; + debtor: string; + collateral_denom: string; + collateral_amount_liquidated: string; + collateral_amount_liquidator: string; + collateral_amount_fee: string; + liquidation_price: string; + market_price: string; + discount: string; + debt_denom: string; + debt_amount: string; + block_height: bigint; + block_time: Date | undefined; + transaction_hash: string; +} +function createBaseCDPLiquidations(): CDPLiquidations { + return { + id: BigInt(0), + liquidator: "", + debtor: "", + collateralDenom: "", + collateralAmountLiquidated: "", + collateralAmountLiquidator: "", + collateralAmountFee: "", + liquidationPrice: "", + marketPrice: "", + discount: "", + debtDenom: "", + debtAmount: "", + blockHeight: BigInt(0), + blockTime: new Date(), + transactionHash: "" + }; +} +export const CDPLiquidations = { + typeUrl: "/Switcheo.carbon.cdp.CDPLiquidations", + encode(message: CDPLiquidations, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.liquidator !== "") { + writer.uint32(18).string(message.liquidator); + } + if (message.debtor !== "") { + writer.uint32(26).string(message.debtor); + } + if (message.collateralDenom !== "") { + writer.uint32(34).string(message.collateralDenom); + } + if (message.collateralAmountLiquidated !== "") { + writer.uint32(42).string(message.collateralAmountLiquidated); + } + if (message.collateralAmountLiquidator !== "") { + writer.uint32(50).string(message.collateralAmountLiquidator); + } + if (message.collateralAmountFee !== "") { + writer.uint32(58).string(message.collateralAmountFee); + } + if (message.liquidationPrice !== "") { + writer.uint32(66).string(Decimal.fromUserInput(message.liquidationPrice, 18).atomics); + } + if (message.marketPrice !== "") { + writer.uint32(74).string(Decimal.fromUserInput(message.marketPrice, 18).atomics); + } + if (message.discount !== "") { + writer.uint32(82).string(Decimal.fromUserInput(message.discount, 18).atomics); + } + if (message.debtDenom !== "") { + writer.uint32(90).string(message.debtDenom); + } + if (message.debtAmount !== "") { + writer.uint32(98).string(message.debtAmount); + } + if (message.blockHeight !== BigInt(0)) { + writer.uint32(104).int64(message.blockHeight); + } + if (message.blockTime !== undefined) { + Timestamp.encode(toTimestamp(message.blockTime), writer.uint32(114).fork()).ldelim(); + } + if (message.transactionHash !== "") { + writer.uint32(122).string(message.transactionHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CDPLiquidations { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCDPLiquidations(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.liquidator = reader.string(); + break; + case 3: + message.debtor = reader.string(); + break; + case 4: + message.collateralDenom = reader.string(); + break; + case 5: + message.collateralAmountLiquidated = reader.string(); + break; + case 6: + message.collateralAmountLiquidator = reader.string(); + break; + case 7: + message.collateralAmountFee = reader.string(); + break; + case 8: + message.liquidationPrice = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 9: + message.marketPrice = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 10: + message.discount = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 11: + message.debtDenom = reader.string(); + break; + case 12: + message.debtAmount = reader.string(); + break; + case 13: + message.blockHeight = reader.int64(); + break; + case 14: + message.blockTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 15: + message.transactionHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CDPLiquidations { + const message = createBaseCDPLiquidations(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.liquidator = object.liquidator ?? ""; + message.debtor = object.debtor ?? ""; + message.collateralDenom = object.collateralDenom ?? ""; + message.collateralAmountLiquidated = object.collateralAmountLiquidated ?? ""; + message.collateralAmountLiquidator = object.collateralAmountLiquidator ?? ""; + message.collateralAmountFee = object.collateralAmountFee ?? ""; + message.liquidationPrice = object.liquidationPrice ?? ""; + message.marketPrice = object.marketPrice ?? ""; + message.discount = object.discount ?? ""; + message.debtDenom = object.debtDenom ?? ""; + message.debtAmount = object.debtAmount ?? ""; + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.blockTime = object.blockTime ?? undefined; + message.transactionHash = object.transactionHash ?? ""; + return message; + }, + fromAmino(object: CDPLiquidationsAmino): CDPLiquidations { + const message = createBaseCDPLiquidations(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.liquidator !== undefined && object.liquidator !== null) { + message.liquidator = object.liquidator; + } + if (object.debtor !== undefined && object.debtor !== null) { + message.debtor = object.debtor; + } + if (object.collateral_denom !== undefined && object.collateral_denom !== null) { + message.collateralDenom = object.collateral_denom; + } + if (object.collateral_amount_liquidated !== undefined && object.collateral_amount_liquidated !== null) { + message.collateralAmountLiquidated = object.collateral_amount_liquidated; + } + if (object.collateral_amount_liquidator !== undefined && object.collateral_amount_liquidator !== null) { + message.collateralAmountLiquidator = object.collateral_amount_liquidator; + } + if (object.collateral_amount_fee !== undefined && object.collateral_amount_fee !== null) { + message.collateralAmountFee = object.collateral_amount_fee; + } + if (object.liquidation_price !== undefined && object.liquidation_price !== null) { + message.liquidationPrice = object.liquidation_price; + } + if (object.market_price !== undefined && object.market_price !== null) { + message.marketPrice = object.market_price; + } + if (object.discount !== undefined && object.discount !== null) { + message.discount = object.discount; + } + if (object.debt_denom !== undefined && object.debt_denom !== null) { + message.debtDenom = object.debt_denom; + } + if (object.debt_amount !== undefined && object.debt_amount !== null) { + message.debtAmount = object.debt_amount; + } + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.block_time !== undefined && object.block_time !== null) { + message.blockTime = fromTimestamp(Timestamp.fromAmino(object.block_time)); + } + if (object.transaction_hash !== undefined && object.transaction_hash !== null) { + message.transactionHash = object.transaction_hash; + } + return message; + }, + toAmino(message: CDPLiquidations, useInterfaces: boolean = false): CDPLiquidationsAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.liquidator = message.liquidator === "" ? undefined : message.liquidator; + obj.debtor = message.debtor === "" ? undefined : message.debtor; + obj.collateral_denom = message.collateralDenom === "" ? undefined : message.collateralDenom; + obj.collateral_amount_liquidated = message.collateralAmountLiquidated === "" ? undefined : message.collateralAmountLiquidated; + obj.collateral_amount_liquidator = message.collateralAmountLiquidator === "" ? undefined : message.collateralAmountLiquidator; + obj.collateral_amount_fee = message.collateralAmountFee === "" ? undefined : message.collateralAmountFee; + obj.liquidation_price = message.liquidationPrice === "" ? undefined : message.liquidationPrice; + obj.market_price = message.marketPrice === "" ? undefined : message.marketPrice; + obj.discount = message.discount === "" ? undefined : message.discount; + obj.debt_denom = message.debtDenom === "" ? undefined : message.debtDenom; + obj.debt_amount = message.debtAmount === "" ? undefined : message.debtAmount; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight.toString() : undefined; + obj.block_time = message.blockTime ? Timestamp.toAmino(toTimestamp(message.blockTime)) : undefined; + obj.transaction_hash = message.transactionHash === "" ? undefined : message.transactionHash; + return obj; + }, + fromAminoMsg(object: CDPLiquidationsAminoMsg): CDPLiquidations { + return CDPLiquidations.fromAmino(object.value); + }, + fromProtoMsg(message: CDPLiquidationsProtoMsg, useInterfaces: boolean = false): CDPLiquidations { + return CDPLiquidations.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CDPLiquidations): Uint8Array { + return CDPLiquidations.encode(message).finish(); + }, + toProtoMsg(message: CDPLiquidations): CDPLiquidationsProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.CDPLiquidations", + value: CDPLiquidations.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/debt_info.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/debt_info.ts new file mode 100644 index 000000000..0f0a00f8f --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/debt_info.ts @@ -0,0 +1,159 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { Decimal } from "@cosmjs/math"; +export interface DebtInfo { + denom: string; + lastUpdatedTime: Date | undefined; + totalPrincipal: string; + cumulativeInterestMultiplier: string; + totalAccumulatedInterest: string; + utilizationRate: string; +} +export interface DebtInfoProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.DebtInfo"; + value: Uint8Array; +} +export interface DebtInfoAmino { + denom?: string; + last_updated_time?: string | undefined; + total_principal?: string; + cumulative_interest_multiplier?: string; + total_accumulated_interest?: string; + utilization_rate?: string; +} +export interface DebtInfoAminoMsg { + type: "/Switcheo.carbon.cdp.DebtInfo"; + value: DebtInfoAmino; +} +export interface DebtInfoSDKType { + denom: string; + last_updated_time: Date | undefined; + total_principal: string; + cumulative_interest_multiplier: string; + total_accumulated_interest: string; + utilization_rate: string; +} +function createBaseDebtInfo(): DebtInfo { + return { + denom: "", + lastUpdatedTime: new Date(), + totalPrincipal: "", + cumulativeInterestMultiplier: "", + totalAccumulatedInterest: "", + utilizationRate: "" + }; +} +export const DebtInfo = { + typeUrl: "/Switcheo.carbon.cdp.DebtInfo", + encode(message: DebtInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.lastUpdatedTime !== undefined) { + Timestamp.encode(toTimestamp(message.lastUpdatedTime), writer.uint32(18).fork()).ldelim(); + } + if (message.totalPrincipal !== "") { + writer.uint32(26).string(message.totalPrincipal); + } + if (message.cumulativeInterestMultiplier !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.cumulativeInterestMultiplier, 18).atomics); + } + if (message.totalAccumulatedInterest !== "") { + writer.uint32(42).string(message.totalAccumulatedInterest); + } + if (message.utilizationRate !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.utilizationRate, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): DebtInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDebtInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.lastUpdatedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.totalPrincipal = reader.string(); + break; + case 4: + message.cumulativeInterestMultiplier = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.totalAccumulatedInterest = reader.string(); + break; + case 6: + message.utilizationRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DebtInfo { + const message = createBaseDebtInfo(); + message.denom = object.denom ?? ""; + message.lastUpdatedTime = object.lastUpdatedTime ?? undefined; + message.totalPrincipal = object.totalPrincipal ?? ""; + message.cumulativeInterestMultiplier = object.cumulativeInterestMultiplier ?? ""; + message.totalAccumulatedInterest = object.totalAccumulatedInterest ?? ""; + message.utilizationRate = object.utilizationRate ?? ""; + return message; + }, + fromAmino(object: DebtInfoAmino): DebtInfo { + const message = createBaseDebtInfo(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.last_updated_time !== undefined && object.last_updated_time !== null) { + message.lastUpdatedTime = fromTimestamp(Timestamp.fromAmino(object.last_updated_time)); + } + if (object.total_principal !== undefined && object.total_principal !== null) { + message.totalPrincipal = object.total_principal; + } + if (object.cumulative_interest_multiplier !== undefined && object.cumulative_interest_multiplier !== null) { + message.cumulativeInterestMultiplier = object.cumulative_interest_multiplier; + } + if (object.total_accumulated_interest !== undefined && object.total_accumulated_interest !== null) { + message.totalAccumulatedInterest = object.total_accumulated_interest; + } + if (object.utilization_rate !== undefined && object.utilization_rate !== null) { + message.utilizationRate = object.utilization_rate; + } + return message; + }, + toAmino(message: DebtInfo, useInterfaces: boolean = false): DebtInfoAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.last_updated_time = message.lastUpdatedTime ? Timestamp.toAmino(toTimestamp(message.lastUpdatedTime)) : undefined; + obj.total_principal = message.totalPrincipal === "" ? undefined : message.totalPrincipal; + obj.cumulative_interest_multiplier = message.cumulativeInterestMultiplier === "" ? undefined : message.cumulativeInterestMultiplier; + obj.total_accumulated_interest = message.totalAccumulatedInterest === "" ? undefined : message.totalAccumulatedInterest; + obj.utilization_rate = message.utilizationRate === "" ? undefined : message.utilizationRate; + return obj; + }, + fromAminoMsg(object: DebtInfoAminoMsg): DebtInfo { + return DebtInfo.fromAmino(object.value); + }, + fromProtoMsg(message: DebtInfoProtoMsg, useInterfaces: boolean = false): DebtInfo { + return DebtInfo.decode(message.value, undefined, useInterfaces); + }, + toProto(message: DebtInfo): Uint8Array { + return DebtInfo.encode(message).finish(); + }, + toProtoMsg(message: DebtInfo): DebtInfoProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.DebtInfo", + value: DebtInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/e_mode_category.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/e_mode_category.ts new file mode 100644 index 000000000..6d796172b --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/e_mode_category.ts @@ -0,0 +1,158 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface EModeCategory { + name: string; + denoms: string[]; + loanToValue: string; + liquidationThreshold: string; + liquidationDiscount: string; + isActive: boolean; +} +export interface EModeCategoryProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.EModeCategory"; + value: Uint8Array; +} +export interface EModeCategoryAmino { + name?: string; + denoms?: string[]; + loan_to_value?: string; + liquidation_threshold?: string; + liquidation_discount?: string; + is_active?: boolean; +} +export interface EModeCategoryAminoMsg { + type: "/Switcheo.carbon.cdp.EModeCategory"; + value: EModeCategoryAmino; +} +export interface EModeCategorySDKType { + name: string; + denoms: string[]; + loan_to_value: string; + liquidation_threshold: string; + liquidation_discount: string; + is_active: boolean; +} +function createBaseEModeCategory(): EModeCategory { + return { + name: "", + denoms: [], + loanToValue: "", + liquidationThreshold: "", + liquidationDiscount: "", + isActive: false + }; +} +export const EModeCategory = { + typeUrl: "/Switcheo.carbon.cdp.EModeCategory", + encode(message: EModeCategory, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.denoms) { + writer.uint32(18).string(v!); + } + if (message.loanToValue !== "") { + writer.uint32(26).string(message.loanToValue); + } + if (message.liquidationThreshold !== "") { + writer.uint32(34).string(message.liquidationThreshold); + } + if (message.liquidationDiscount !== "") { + writer.uint32(42).string(message.liquidationDiscount); + } + if (message.isActive === true) { + writer.uint32(48).bool(message.isActive); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): EModeCategory { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEModeCategory(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.denoms.push(reader.string()); + break; + case 3: + message.loanToValue = reader.string(); + break; + case 4: + message.liquidationThreshold = reader.string(); + break; + case 5: + message.liquidationDiscount = reader.string(); + break; + case 6: + message.isActive = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EModeCategory { + const message = createBaseEModeCategory(); + message.name = object.name ?? ""; + message.denoms = object.denoms?.map(e => e) || []; + message.loanToValue = object.loanToValue ?? ""; + message.liquidationThreshold = object.liquidationThreshold ?? ""; + message.liquidationDiscount = object.liquidationDiscount ?? ""; + message.isActive = object.isActive ?? false; + return message; + }, + fromAmino(object: EModeCategoryAmino): EModeCategory { + const message = createBaseEModeCategory(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.denoms = object.denoms?.map(e => e) || []; + if (object.loan_to_value !== undefined && object.loan_to_value !== null) { + message.loanToValue = object.loan_to_value; + } + if (object.liquidation_threshold !== undefined && object.liquidation_threshold !== null) { + message.liquidationThreshold = object.liquidation_threshold; + } + if (object.liquidation_discount !== undefined && object.liquidation_discount !== null) { + message.liquidationDiscount = object.liquidation_discount; + } + if (object.is_active !== undefined && object.is_active !== null) { + message.isActive = object.is_active; + } + return message; + }, + toAmino(message: EModeCategory, useInterfaces: boolean = false): EModeCategoryAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = message.denoms; + } + obj.loan_to_value = message.loanToValue === "" ? undefined : message.loanToValue; + obj.liquidation_threshold = message.liquidationThreshold === "" ? undefined : message.liquidationThreshold; + obj.liquidation_discount = message.liquidationDiscount === "" ? undefined : message.liquidationDiscount; + obj.is_active = message.isActive === false ? undefined : message.isActive; + return obj; + }, + fromAminoMsg(object: EModeCategoryAminoMsg): EModeCategory { + return EModeCategory.fromAmino(object.value); + }, + fromProtoMsg(message: EModeCategoryProtoMsg, useInterfaces: boolean = false): EModeCategory { + return EModeCategory.decode(message.value, undefined, useInterfaces); + }, + toProto(message: EModeCategory): Uint8Array { + return EModeCategory.encode(message).finish(); + }, + toProtoMsg(message: EModeCategory): EModeCategoryProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.EModeCategory", + value: EModeCategory.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/event.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/event.ts new file mode 100644 index 000000000..213bc7d2f --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/event.ts @@ -0,0 +1,3821 @@ +import { RateStrategyParams, RateStrategyParamsAmino, RateStrategyParamsSDKType } from "./rate_strategy_params"; +import { AssetParams, AssetParamsAmino, AssetParamsSDKType } from "./asset_params"; +import { EModeCategory, EModeCategoryAmino, EModeCategorySDKType } from "./e_mode_category"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { DebtInfo, DebtInfoAmino, DebtInfoSDKType } from "./debt_info"; +import { StablecoinDebtInfo, StablecoinDebtInfoAmino, StablecoinDebtInfoSDKType } from "./stablecoin_debt_info"; +import { RewardDebt, RewardDebtAmino, RewardDebtSDKType, RewardScheme, RewardSchemeAmino, RewardSchemeSDKType } from "./reward_scheme"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +export interface NewRateStrategyParamsEvent { + rateStrategyParams: RateStrategyParams | undefined; + type: string; +} +export interface NewRateStrategyParamsEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.NewRateStrategyParamsEvent"; + value: Uint8Array; +} +export interface NewRateStrategyParamsEventAmino { + rate_strategy_params?: RateStrategyParamsAmino | undefined; + type?: string; +} +export interface NewRateStrategyParamsEventAminoMsg { + type: "/Switcheo.carbon.cdp.NewRateStrategyParamsEvent"; + value: NewRateStrategyParamsEventAmino; +} +export interface NewRateStrategyParamsEventSDKType { + rate_strategy_params: RateStrategyParamsSDKType | undefined; + type: string; +} +export interface UpdateRateStrategyParamsEvent { + rateStrategyParams: RateStrategyParams | undefined; + type: string; +} +export interface UpdateRateStrategyParamsEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.UpdateRateStrategyParamsEvent"; + value: Uint8Array; +} +export interface UpdateRateStrategyParamsEventAmino { + rate_strategy_params?: RateStrategyParamsAmino | undefined; + type?: string; +} +export interface UpdateRateStrategyParamsEventAminoMsg { + type: "/Switcheo.carbon.cdp.UpdateRateStrategyParamsEvent"; + value: UpdateRateStrategyParamsEventAmino; +} +export interface UpdateRateStrategyParamsEventSDKType { + rate_strategy_params: RateStrategyParamsSDKType | undefined; + type: string; +} +export interface RemoveRateStrategyParamsEvent { + rateStrategyParams: RateStrategyParams | undefined; + type: string; +} +export interface RemoveRateStrategyParamsEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.RemoveRateStrategyParamsEvent"; + value: Uint8Array; +} +export interface RemoveRateStrategyParamsEventAmino { + rate_strategy_params?: RateStrategyParamsAmino | undefined; + type?: string; +} +export interface RemoveRateStrategyParamsEventAminoMsg { + type: "/Switcheo.carbon.cdp.RemoveRateStrategyParamsEvent"; + value: RemoveRateStrategyParamsEventAmino; +} +export interface RemoveRateStrategyParamsEventSDKType { + rate_strategy_params: RateStrategyParamsSDKType | undefined; + type: string; +} +export interface NewAssetParamsEvent { + assetParams: AssetParams | undefined; + type: string; +} +export interface NewAssetParamsEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.NewAssetParamsEvent"; + value: Uint8Array; +} +export interface NewAssetParamsEventAmino { + asset_params?: AssetParamsAmino | undefined; + type?: string; +} +export interface NewAssetParamsEventAminoMsg { + type: "/Switcheo.carbon.cdp.NewAssetParamsEvent"; + value: NewAssetParamsEventAmino; +} +export interface NewAssetParamsEventSDKType { + asset_params: AssetParamsSDKType | undefined; + type: string; +} +export interface UpdateAssetParamsEvent { + assetParams: AssetParams | undefined; + type: string; +} +export interface UpdateAssetParamsEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.UpdateAssetParamsEvent"; + value: Uint8Array; +} +export interface UpdateAssetParamsEventAmino { + asset_params?: AssetParamsAmino | undefined; + type?: string; +} +export interface UpdateAssetParamsEventAminoMsg { + type: "/Switcheo.carbon.cdp.UpdateAssetParamsEvent"; + value: UpdateAssetParamsEventAmino; +} +export interface UpdateAssetParamsEventSDKType { + asset_params: AssetParamsSDKType | undefined; + type: string; +} +export interface NewEModeCategoryEvent { + eModeCategory: EModeCategory | undefined; + type: string; +} +export interface NewEModeCategoryEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.NewEModeCategoryEvent"; + value: Uint8Array; +} +export interface NewEModeCategoryEventAmino { + e_mode_category?: EModeCategoryAmino | undefined; + type?: string; +} +export interface NewEModeCategoryEventAminoMsg { + type: "/Switcheo.carbon.cdp.NewEModeCategoryEvent"; + value: NewEModeCategoryEventAmino; +} +export interface NewEModeCategoryEventSDKType { + e_mode_category: EModeCategorySDKType | undefined; + type: string; +} +export interface UpdateEModeCategoryEvent { + eModeCategory: EModeCategory | undefined; + type: string; +} +export interface UpdateEModeCategoryEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.UpdateEModeCategoryEvent"; + value: Uint8Array; +} +export interface UpdateEModeCategoryEventAmino { + e_mode_category?: EModeCategoryAmino | undefined; + type?: string; +} +export interface UpdateEModeCategoryEventAminoMsg { + type: "/Switcheo.carbon.cdp.UpdateEModeCategoryEvent"; + value: UpdateEModeCategoryEventAmino; +} +export interface UpdateEModeCategoryEventSDKType { + e_mode_category: EModeCategorySDKType | undefined; + type: string; +} +export interface UpdateAccountEModeCategoryNameEvent { + account: string; + eModeCategoryName: string; +} +export interface UpdateAccountEModeCategoryNameEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.UpdateAccountEModeCategoryNameEvent"; + value: Uint8Array; +} +export interface UpdateAccountEModeCategoryNameEventAmino { + account?: string; + e_mode_category_name?: string; +} +export interface UpdateAccountEModeCategoryNameEventAminoMsg { + type: "/Switcheo.carbon.cdp.UpdateAccountEModeCategoryNameEvent"; + value: UpdateAccountEModeCategoryNameEventAmino; +} +export interface UpdateAccountEModeCategoryNameEventSDKType { + account: string; + e_mode_category_name: string; +} +export interface SetInterestFeeEvent { + interestFee: string; + type: string; +} +export interface SetInterestFeeEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.SetInterestFeeEvent"; + value: Uint8Array; +} +export interface SetInterestFeeEventAmino { + interest_fee?: string; + type?: string; +} +export interface SetInterestFeeEventAminoMsg { + type: "/Switcheo.carbon.cdp.SetInterestFeeEvent"; + value: SetInterestFeeEventAmino; +} +export interface SetInterestFeeEventSDKType { + interest_fee: string; + type: string; +} +export interface SetLiquidationFeeEvent { + liquidationFee: string; + type: string; +} +export interface SetLiquidationFeeEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.SetLiquidationFeeEvent"; + value: Uint8Array; +} +export interface SetLiquidationFeeEventAmino { + liquidation_fee?: string; + type?: string; +} +export interface SetLiquidationFeeEventAminoMsg { + type: "/Switcheo.carbon.cdp.SetLiquidationFeeEvent"; + value: SetLiquidationFeeEventAmino; +} +export interface SetLiquidationFeeEventSDKType { + liquidation_fee: string; + type: string; +} +export interface SetStablecoinInterestRateEvent { + /** Deprecated for stablecoin_interest_rate_dec */ + stablecoinInterestRate: string; + type: string; + stablecoinInterestRateDec: string; +} +export interface SetStablecoinInterestRateEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.SetStablecoinInterestRateEvent"; + value: Uint8Array; +} +export interface SetStablecoinInterestRateEventAmino { + /** Deprecated for stablecoin_interest_rate_dec */ + stablecoin_interest_rate?: string; + type?: string; + stablecoin_interest_rate_dec?: string; +} +export interface SetStablecoinInterestRateEventAminoMsg { + type: "/Switcheo.carbon.cdp.SetStablecoinInterestRateEvent"; + value: SetStablecoinInterestRateEventAmino; +} +export interface SetStablecoinInterestRateEventSDKType { + stablecoin_interest_rate: string; + type: string; + stablecoin_interest_rate_dec: string; +} +export interface SetStablecoinMintCapEvent { + stablecoinMintCap: string; + type: string; +} +export interface SetStablecoinMintCapEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.SetStablecoinMintCapEvent"; + value: Uint8Array; +} +export interface SetStablecoinMintCapEventAmino { + stablecoin_mint_cap?: string; + type?: string; +} +export interface SetStablecoinMintCapEventAminoMsg { + type: "/Switcheo.carbon.cdp.SetStablecoinMintCapEvent"; + value: SetStablecoinMintCapEventAmino; +} +export interface SetStablecoinMintCapEventSDKType { + stablecoin_mint_cap: string; + type: string; +} +export interface SetCompleteLiquidationThresholdEvent { + completeLiquidationThreshold: string; + type: string; +} +export interface SetCompleteLiquidationThresholdEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.SetCompleteLiquidationThresholdEvent"; + value: Uint8Array; +} +export interface SetCompleteLiquidationThresholdEventAmino { + complete_liquidation_threshold?: string; + type?: string; +} +export interface SetCompleteLiquidationThresholdEventAminoMsg { + type: "/Switcheo.carbon.cdp.SetCompleteLiquidationThresholdEvent"; + value: SetCompleteLiquidationThresholdEventAmino; +} +export interface SetCompleteLiquidationThresholdEventSDKType { + complete_liquidation_threshold: string; + type: string; +} +export interface SetMinimumCloseFactorEvent { + minimumCloseFactor: string; + type: string; +} +export interface SetMinimumCloseFactorEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.SetMinimumCloseFactorEvent"; + value: Uint8Array; +} +export interface SetMinimumCloseFactorEventAmino { + minimum_close_factor?: string; + type?: string; +} +export interface SetMinimumCloseFactorEventAminoMsg { + type: "/Switcheo.carbon.cdp.SetMinimumCloseFactorEvent"; + value: SetMinimumCloseFactorEventAmino; +} +export interface SetMinimumCloseFactorEventSDKType { + minimum_close_factor: string; + type: string; +} +export interface SetSmallLiquidationSizeEvent { + smallLiquidationSize: string; + type: string; +} +export interface SetSmallLiquidationSizeEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.SetSmallLiquidationSizeEvent"; + value: Uint8Array; +} +export interface SetSmallLiquidationSizeEventAmino { + small_liquidation_size?: string; + type?: string; +} +export interface SetSmallLiquidationSizeEventAminoMsg { + type: "/Switcheo.carbon.cdp.SetSmallLiquidationSizeEvent"; + value: SetSmallLiquidationSizeEventAmino; +} +export interface SetSmallLiquidationSizeEventSDKType { + small_liquidation_size: string; + type: string; +} +export interface SetStalePriceGracePeriodEvent { + stalePriceGracePeriod: Duration | undefined; + type: string; +} +export interface SetStalePriceGracePeriodEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.SetStalePriceGracePeriodEvent"; + value: Uint8Array; +} +export interface SetStalePriceGracePeriodEventAmino { + stale_price_grace_period?: DurationAmino | undefined; + type?: string; +} +export interface SetStalePriceGracePeriodEventAminoMsg { + type: "/Switcheo.carbon.cdp.SetStalePriceGracePeriodEvent"; + value: SetStalePriceGracePeriodEventAmino; +} +export interface SetStalePriceGracePeriodEventSDKType { + stale_price_grace_period: DurationSDKType | undefined; + type: string; +} +export interface SetCdpPausedEvent { + cdpPaused: boolean; + type: string; +} +export interface SetCdpPausedEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.SetCdpPausedEvent"; + value: Uint8Array; +} +export interface SetCdpPausedEventAmino { + cdp_paused?: boolean; + type?: string; +} +export interface SetCdpPausedEventAminoMsg { + type: "/Switcheo.carbon.cdp.SetCdpPausedEvent"; + value: SetCdpPausedEventAmino; +} +export interface SetCdpPausedEventSDKType { + cdp_paused: boolean; + type: string; +} +export interface SupplyAssetEvent { + supplier: string; + denom: string; + amountSupplied: string; + cibtDenom: string; + amountMinted: string; +} +export interface SupplyAssetEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.SupplyAssetEvent"; + value: Uint8Array; +} +export interface SupplyAssetEventAmino { + supplier?: string; + denom?: string; + amount_supplied?: string; + cibt_denom?: string; + amount_minted?: string; +} +export interface SupplyAssetEventAminoMsg { + type: "/Switcheo.carbon.cdp.SupplyAssetEvent"; + value: SupplyAssetEventAmino; +} +export interface SupplyAssetEventSDKType { + supplier: string; + denom: string; + amount_supplied: string; + cibt_denom: string; + amount_minted: string; +} +export interface WithdrawAssetEvent { + withdrawer: string; + denom: string; + amountWithdrawed: string; + cibtDenom: string; + amountBurned: string; +} +export interface WithdrawAssetEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.WithdrawAssetEvent"; + value: Uint8Array; +} +export interface WithdrawAssetEventAmino { + withdrawer?: string; + denom?: string; + amount_withdrawed?: string; + cibt_denom?: string; + amount_burned?: string; +} +export interface WithdrawAssetEventAminoMsg { + type: "/Switcheo.carbon.cdp.WithdrawAssetEvent"; + value: WithdrawAssetEventAmino; +} +export interface WithdrawAssetEventSDKType { + withdrawer: string; + denom: string; + amount_withdrawed: string; + cibt_denom: string; + amount_burned: string; +} +export interface BorrowAssetEvent { + borrower: string; + denom: string; + amountBorrowed: string; + debtValue: string; + collateralValue: string; + initialCumulativeInterestMultiplier: string; +} +export interface BorrowAssetEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.BorrowAssetEvent"; + value: Uint8Array; +} +export interface BorrowAssetEventAmino { + borrower?: string; + denom?: string; + amount_borrowed?: string; + debt_value?: string; + collateral_value?: string; + initial_cumulative_interest_multiplier?: string; +} +export interface BorrowAssetEventAminoMsg { + type: "/Switcheo.carbon.cdp.BorrowAssetEvent"; + value: BorrowAssetEventAmino; +} +export interface BorrowAssetEventSDKType { + borrower: string; + denom: string; + amount_borrowed: string; + debt_value: string; + collateral_value: string; + initial_cumulative_interest_multiplier: string; +} +export interface RepayAssetEvent { + repayer: string; + debtor: string; + denom: string; + principalRepaid: string; + interestRepaid: string; + debtValue: string; + collateralValue: string; +} +export interface RepayAssetEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.RepayAssetEvent"; + value: Uint8Array; +} +export interface RepayAssetEventAmino { + repayer?: string; + debtor?: string; + denom?: string; + principal_repaid?: string; + interest_repaid?: string; + debt_value?: string; + collateral_value?: string; +} +export interface RepayAssetEventAminoMsg { + type: "/Switcheo.carbon.cdp.RepayAssetEvent"; + value: RepayAssetEventAmino; +} +export interface RepayAssetEventSDKType { + repayer: string; + debtor: string; + denom: string; + principal_repaid: string; + interest_repaid: string; + debt_value: string; + collateral_value: string; +} +export interface LockCollateralEvent { + locker: string; + cibtDenom: string; + amountLocked: string; + debtValue: string; + collateralValue: string; +} +export interface LockCollateralEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.LockCollateralEvent"; + value: Uint8Array; +} +export interface LockCollateralEventAmino { + locker?: string; + cibt_denom?: string; + amount_locked?: string; + debt_value?: string; + collateral_value?: string; +} +export interface LockCollateralEventAminoMsg { + type: "/Switcheo.carbon.cdp.LockCollateralEvent"; + value: LockCollateralEventAmino; +} +export interface LockCollateralEventSDKType { + locker: string; + cibt_denom: string; + amount_locked: string; + debt_value: string; + collateral_value: string; +} +export interface UnlockCollateralEvent { + unlocker: string; + cibtDenom: string; + amountUnlocked: string; + debtValue: string; + collateralValue: string; +} +export interface UnlockCollateralEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.UnlockCollateralEvent"; + value: Uint8Array; +} +export interface UnlockCollateralEventAmino { + unlocker?: string; + cibt_denom?: string; + amount_unlocked?: string; + debt_value?: string; + collateral_value?: string; +} +export interface UnlockCollateralEventAminoMsg { + type: "/Switcheo.carbon.cdp.UnlockCollateralEvent"; + value: UnlockCollateralEventAmino; +} +export interface UnlockCollateralEventSDKType { + unlocker: string; + cibt_denom: string; + amount_unlocked: string; + debt_value: string; + collateral_value: string; +} +export interface UpdateDebtInfoEvent { + debtInfo: DebtInfo | undefined; + type: string; +} +export interface UpdateDebtInfoEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.UpdateDebtInfoEvent"; + value: Uint8Array; +} +export interface UpdateDebtInfoEventAmino { + debt_info?: DebtInfoAmino | undefined; + type?: string; +} +export interface UpdateDebtInfoEventAminoMsg { + type: "/Switcheo.carbon.cdp.UpdateDebtInfoEvent"; + value: UpdateDebtInfoEventAmino; +} +export interface UpdateDebtInfoEventSDKType { + debt_info: DebtInfoSDKType | undefined; + type: string; +} +export interface UpdateStablecoinDebtInfoEvent { + stablecoinDebtInfo: StablecoinDebtInfo | undefined; + type: string; +} +export interface UpdateStablecoinDebtInfoEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.UpdateStablecoinDebtInfoEvent"; + value: Uint8Array; +} +export interface UpdateStablecoinDebtInfoEventAmino { + stablecoin_debt_info?: StablecoinDebtInfoAmino | undefined; + type?: string; +} +export interface UpdateStablecoinDebtInfoEventAminoMsg { + type: "/Switcheo.carbon.cdp.UpdateStablecoinDebtInfoEvent"; + value: UpdateStablecoinDebtInfoEventAmino; +} +export interface UpdateStablecoinDebtInfoEventSDKType { + stablecoin_debt_info: StablecoinDebtInfoSDKType | undefined; + type: string; +} +export interface MintStablecoinEvent { + minter: string; + denom: string; + amountMinted: string; + debtValue: string; + collateralValue: string; + initialCumulativeInterestMultiplier: string; +} +export interface MintStablecoinEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MintStablecoinEvent"; + value: Uint8Array; +} +export interface MintStablecoinEventAmino { + minter?: string; + denom?: string; + amount_minted?: string; + debt_value?: string; + collateral_value?: string; + initial_cumulative_interest_multiplier?: string; +} +export interface MintStablecoinEventAminoMsg { + type: "/Switcheo.carbon.cdp.MintStablecoinEvent"; + value: MintStablecoinEventAmino; +} +export interface MintStablecoinEventSDKType { + minter: string; + denom: string; + amount_minted: string; + debt_value: string; + collateral_value: string; + initial_cumulative_interest_multiplier: string; +} +export interface ReturnStablecoinEvent { + returner: string; + debtor: string; + interestDenom: string; + interestRepaid: string; + principalRepaid: string; + debtValue: string; + collateralValue: string; +} +export interface ReturnStablecoinEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.ReturnStablecoinEvent"; + value: Uint8Array; +} +export interface ReturnStablecoinEventAmino { + returner?: string; + debtor?: string; + interest_denom?: string; + interest_repaid?: string; + principal_repaid?: string; + debt_value?: string; + collateral_value?: string; +} +export interface ReturnStablecoinEventAminoMsg { + type: "/Switcheo.carbon.cdp.ReturnStablecoinEvent"; + value: ReturnStablecoinEventAmino; +} +export interface ReturnStablecoinEventSDKType { + returner: string; + debtor: string; + interest_denom: string; + interest_repaid: string; + principal_repaid: string; + debt_value: string; + collateral_value: string; +} +export interface LiquidateCollateralEvent { + liquidator: string; + debtor: string; + collateralDenom: string; + collateralAmountLiquidated: string; + collateralAmountLiquidator: string; + collateralAmountFee: string; + liquidationPrice: string; + marketPrice: string; + discount: string; + debtDenom: string; + debtAmount: string; + id: bigint; + principalAmount: string; + interestDenom: string; + interestAmount: string; +} +export interface LiquidateCollateralEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.LiquidateCollateralEvent"; + value: Uint8Array; +} +export interface LiquidateCollateralEventAmino { + liquidator?: string; + debtor?: string; + collateral_denom?: string; + collateral_amount_liquidated?: string; + collateral_amount_liquidator?: string; + collateral_amount_fee?: string; + liquidation_price?: string; + market_price?: string; + discount?: string; + debt_denom?: string; + debt_amount?: string; + id?: string; + principal_amount?: string; + interest_denom?: string; + interest_amount?: string; +} +export interface LiquidateCollateralEventAminoMsg { + type: "/Switcheo.carbon.cdp.LiquidateCollateralEvent"; + value: LiquidateCollateralEventAmino; +} +export interface LiquidateCollateralEventSDKType { + liquidator: string; + debtor: string; + collateral_denom: string; + collateral_amount_liquidated: string; + collateral_amount_liquidator: string; + collateral_amount_fee: string; + liquidation_price: string; + market_price: string; + discount: string; + debt_denom: string; + debt_amount: string; + id: bigint; + principal_amount: string; + interest_denom: string; + interest_amount: string; +} +export interface ClaimRewardEvent { + receiver: string; + rewardSchemeId: string; + rewardClaimed: string; +} +export interface ClaimRewardEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.ClaimRewardEvent"; + value: Uint8Array; +} +export interface ClaimRewardEventAmino { + receiver?: string; + reward_scheme_id?: string; + reward_claimed?: string; +} +export interface ClaimRewardEventAminoMsg { + type: "/Switcheo.carbon.cdp.ClaimRewardEvent"; + value: ClaimRewardEventAmino; +} +export interface ClaimRewardEventSDKType { + receiver: string; + reward_scheme_id: string; + reward_claimed: string; +} +export interface RewardDebtEvent { + rewardDebt?: RewardDebt | undefined; + type: string; +} +export interface RewardDebtEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.RewardDebtEvent"; + value: Uint8Array; +} +export interface RewardDebtEventAmino { + reward_debt?: RewardDebtAmino | undefined; + type?: string; +} +export interface RewardDebtEventAminoMsg { + type: "/Switcheo.carbon.cdp.RewardDebtEvent"; + value: RewardDebtEventAmino; +} +export interface RewardDebtEventSDKType { + reward_debt?: RewardDebtSDKType | undefined; + type: string; +} +export interface RewardSchemeEvent { + rewardScheme?: RewardScheme | undefined; + type: string; +} +export interface RewardSchemeEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.RewardSchemeEvent"; + value: Uint8Array; +} +export interface RewardSchemeEventAmino { + reward_scheme?: RewardSchemeAmino | undefined; + type?: string; +} +export interface RewardSchemeEventAminoMsg { + type: "/Switcheo.carbon.cdp.RewardSchemeEvent"; + value: RewardSchemeEventAmino; +} +export interface RewardSchemeEventSDKType { + reward_scheme?: RewardSchemeSDKType | undefined; + type: string; +} +export interface AddReserveEvent { + rewardScheme?: RewardScheme | undefined; + amountAdded: string; +} +export interface AddReserveEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.AddReserveEvent"; + value: Uint8Array; +} +export interface AddReserveEventAmino { + reward_scheme?: RewardSchemeAmino | undefined; + amount_added?: string; +} +export interface AddReserveEventAminoMsg { + type: "/Switcheo.carbon.cdp.AddReserveEvent"; + value: AddReserveEventAmino; +} +export interface AddReserveEventSDKType { + reward_scheme?: RewardSchemeSDKType | undefined; + amount_added: string; +} +export interface RefundReserveEvent { + rewardScheme?: RewardScheme | undefined; + amountRefunded: string; +} +export interface RefundReserveEventProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.RefundReserveEvent"; + value: Uint8Array; +} +export interface RefundReserveEventAmino { + reward_scheme?: RewardSchemeAmino | undefined; + amount_refunded?: string; +} +export interface RefundReserveEventAminoMsg { + type: "/Switcheo.carbon.cdp.RefundReserveEvent"; + value: RefundReserveEventAmino; +} +export interface RefundReserveEventSDKType { + reward_scheme?: RewardSchemeSDKType | undefined; + amount_refunded: string; +} +function createBaseNewRateStrategyParamsEvent(): NewRateStrategyParamsEvent { + return { + rateStrategyParams: RateStrategyParams.fromPartial({}), + type: "" + }; +} +export const NewRateStrategyParamsEvent = { + typeUrl: "/Switcheo.carbon.cdp.NewRateStrategyParamsEvent", + encode(message: NewRateStrategyParamsEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rateStrategyParams !== undefined) { + RateStrategyParams.encode(message.rateStrategyParams, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): NewRateStrategyParamsEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewRateStrategyParamsEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rateStrategyParams = RateStrategyParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NewRateStrategyParamsEvent { + const message = createBaseNewRateStrategyParamsEvent(); + message.rateStrategyParams = object.rateStrategyParams !== undefined && object.rateStrategyParams !== null ? RateStrategyParams.fromPartial(object.rateStrategyParams) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: NewRateStrategyParamsEventAmino): NewRateStrategyParamsEvent { + const message = createBaseNewRateStrategyParamsEvent(); + if (object.rate_strategy_params !== undefined && object.rate_strategy_params !== null) { + message.rateStrategyParams = RateStrategyParams.fromAmino(object.rate_strategy_params); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: NewRateStrategyParamsEvent, useInterfaces: boolean = false): NewRateStrategyParamsEventAmino { + const obj: any = {}; + obj.rate_strategy_params = message.rateStrategyParams ? RateStrategyParams.toAmino(message.rateStrategyParams, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: NewRateStrategyParamsEventAminoMsg): NewRateStrategyParamsEvent { + return NewRateStrategyParamsEvent.fromAmino(object.value); + }, + fromProtoMsg(message: NewRateStrategyParamsEventProtoMsg, useInterfaces: boolean = false): NewRateStrategyParamsEvent { + return NewRateStrategyParamsEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: NewRateStrategyParamsEvent): Uint8Array { + return NewRateStrategyParamsEvent.encode(message).finish(); + }, + toProtoMsg(message: NewRateStrategyParamsEvent): NewRateStrategyParamsEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.NewRateStrategyParamsEvent", + value: NewRateStrategyParamsEvent.encode(message).finish() + }; + } +}; +function createBaseUpdateRateStrategyParamsEvent(): UpdateRateStrategyParamsEvent { + return { + rateStrategyParams: RateStrategyParams.fromPartial({}), + type: "" + }; +} +export const UpdateRateStrategyParamsEvent = { + typeUrl: "/Switcheo.carbon.cdp.UpdateRateStrategyParamsEvent", + encode(message: UpdateRateStrategyParamsEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rateStrategyParams !== undefined) { + RateStrategyParams.encode(message.rateStrategyParams, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UpdateRateStrategyParamsEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateRateStrategyParamsEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rateStrategyParams = RateStrategyParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateRateStrategyParamsEvent { + const message = createBaseUpdateRateStrategyParamsEvent(); + message.rateStrategyParams = object.rateStrategyParams !== undefined && object.rateStrategyParams !== null ? RateStrategyParams.fromPartial(object.rateStrategyParams) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: UpdateRateStrategyParamsEventAmino): UpdateRateStrategyParamsEvent { + const message = createBaseUpdateRateStrategyParamsEvent(); + if (object.rate_strategy_params !== undefined && object.rate_strategy_params !== null) { + message.rateStrategyParams = RateStrategyParams.fromAmino(object.rate_strategy_params); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: UpdateRateStrategyParamsEvent, useInterfaces: boolean = false): UpdateRateStrategyParamsEventAmino { + const obj: any = {}; + obj.rate_strategy_params = message.rateStrategyParams ? RateStrategyParams.toAmino(message.rateStrategyParams, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: UpdateRateStrategyParamsEventAminoMsg): UpdateRateStrategyParamsEvent { + return UpdateRateStrategyParamsEvent.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateRateStrategyParamsEventProtoMsg, useInterfaces: boolean = false): UpdateRateStrategyParamsEvent { + return UpdateRateStrategyParamsEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UpdateRateStrategyParamsEvent): Uint8Array { + return UpdateRateStrategyParamsEvent.encode(message).finish(); + }, + toProtoMsg(message: UpdateRateStrategyParamsEvent): UpdateRateStrategyParamsEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.UpdateRateStrategyParamsEvent", + value: UpdateRateStrategyParamsEvent.encode(message).finish() + }; + } +}; +function createBaseRemoveRateStrategyParamsEvent(): RemoveRateStrategyParamsEvent { + return { + rateStrategyParams: RateStrategyParams.fromPartial({}), + type: "" + }; +} +export const RemoveRateStrategyParamsEvent = { + typeUrl: "/Switcheo.carbon.cdp.RemoveRateStrategyParamsEvent", + encode(message: RemoveRateStrategyParamsEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rateStrategyParams !== undefined) { + RateStrategyParams.encode(message.rateStrategyParams, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RemoveRateStrategyParamsEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRemoveRateStrategyParamsEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rateStrategyParams = RateStrategyParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RemoveRateStrategyParamsEvent { + const message = createBaseRemoveRateStrategyParamsEvent(); + message.rateStrategyParams = object.rateStrategyParams !== undefined && object.rateStrategyParams !== null ? RateStrategyParams.fromPartial(object.rateStrategyParams) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: RemoveRateStrategyParamsEventAmino): RemoveRateStrategyParamsEvent { + const message = createBaseRemoveRateStrategyParamsEvent(); + if (object.rate_strategy_params !== undefined && object.rate_strategy_params !== null) { + message.rateStrategyParams = RateStrategyParams.fromAmino(object.rate_strategy_params); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: RemoveRateStrategyParamsEvent, useInterfaces: boolean = false): RemoveRateStrategyParamsEventAmino { + const obj: any = {}; + obj.rate_strategy_params = message.rateStrategyParams ? RateStrategyParams.toAmino(message.rateStrategyParams, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: RemoveRateStrategyParamsEventAminoMsg): RemoveRateStrategyParamsEvent { + return RemoveRateStrategyParamsEvent.fromAmino(object.value); + }, + fromProtoMsg(message: RemoveRateStrategyParamsEventProtoMsg, useInterfaces: boolean = false): RemoveRateStrategyParamsEvent { + return RemoveRateStrategyParamsEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RemoveRateStrategyParamsEvent): Uint8Array { + return RemoveRateStrategyParamsEvent.encode(message).finish(); + }, + toProtoMsg(message: RemoveRateStrategyParamsEvent): RemoveRateStrategyParamsEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.RemoveRateStrategyParamsEvent", + value: RemoveRateStrategyParamsEvent.encode(message).finish() + }; + } +}; +function createBaseNewAssetParamsEvent(): NewAssetParamsEvent { + return { + assetParams: AssetParams.fromPartial({}), + type: "" + }; +} +export const NewAssetParamsEvent = { + typeUrl: "/Switcheo.carbon.cdp.NewAssetParamsEvent", + encode(message: NewAssetParamsEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetParams !== undefined) { + AssetParams.encode(message.assetParams, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): NewAssetParamsEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewAssetParamsEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetParams = AssetParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NewAssetParamsEvent { + const message = createBaseNewAssetParamsEvent(); + message.assetParams = object.assetParams !== undefined && object.assetParams !== null ? AssetParams.fromPartial(object.assetParams) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: NewAssetParamsEventAmino): NewAssetParamsEvent { + const message = createBaseNewAssetParamsEvent(); + if (object.asset_params !== undefined && object.asset_params !== null) { + message.assetParams = AssetParams.fromAmino(object.asset_params); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: NewAssetParamsEvent, useInterfaces: boolean = false): NewAssetParamsEventAmino { + const obj: any = {}; + obj.asset_params = message.assetParams ? AssetParams.toAmino(message.assetParams, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: NewAssetParamsEventAminoMsg): NewAssetParamsEvent { + return NewAssetParamsEvent.fromAmino(object.value); + }, + fromProtoMsg(message: NewAssetParamsEventProtoMsg, useInterfaces: boolean = false): NewAssetParamsEvent { + return NewAssetParamsEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: NewAssetParamsEvent): Uint8Array { + return NewAssetParamsEvent.encode(message).finish(); + }, + toProtoMsg(message: NewAssetParamsEvent): NewAssetParamsEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.NewAssetParamsEvent", + value: NewAssetParamsEvent.encode(message).finish() + }; + } +}; +function createBaseUpdateAssetParamsEvent(): UpdateAssetParamsEvent { + return { + assetParams: AssetParams.fromPartial({}), + type: "" + }; +} +export const UpdateAssetParamsEvent = { + typeUrl: "/Switcheo.carbon.cdp.UpdateAssetParamsEvent", + encode(message: UpdateAssetParamsEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetParams !== undefined) { + AssetParams.encode(message.assetParams, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UpdateAssetParamsEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateAssetParamsEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetParams = AssetParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateAssetParamsEvent { + const message = createBaseUpdateAssetParamsEvent(); + message.assetParams = object.assetParams !== undefined && object.assetParams !== null ? AssetParams.fromPartial(object.assetParams) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: UpdateAssetParamsEventAmino): UpdateAssetParamsEvent { + const message = createBaseUpdateAssetParamsEvent(); + if (object.asset_params !== undefined && object.asset_params !== null) { + message.assetParams = AssetParams.fromAmino(object.asset_params); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: UpdateAssetParamsEvent, useInterfaces: boolean = false): UpdateAssetParamsEventAmino { + const obj: any = {}; + obj.asset_params = message.assetParams ? AssetParams.toAmino(message.assetParams, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: UpdateAssetParamsEventAminoMsg): UpdateAssetParamsEvent { + return UpdateAssetParamsEvent.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateAssetParamsEventProtoMsg, useInterfaces: boolean = false): UpdateAssetParamsEvent { + return UpdateAssetParamsEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UpdateAssetParamsEvent): Uint8Array { + return UpdateAssetParamsEvent.encode(message).finish(); + }, + toProtoMsg(message: UpdateAssetParamsEvent): UpdateAssetParamsEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.UpdateAssetParamsEvent", + value: UpdateAssetParamsEvent.encode(message).finish() + }; + } +}; +function createBaseNewEModeCategoryEvent(): NewEModeCategoryEvent { + return { + eModeCategory: EModeCategory.fromPartial({}), + type: "" + }; +} +export const NewEModeCategoryEvent = { + typeUrl: "/Switcheo.carbon.cdp.NewEModeCategoryEvent", + encode(message: NewEModeCategoryEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eModeCategory !== undefined) { + EModeCategory.encode(message.eModeCategory, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): NewEModeCategoryEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewEModeCategoryEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eModeCategory = EModeCategory.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NewEModeCategoryEvent { + const message = createBaseNewEModeCategoryEvent(); + message.eModeCategory = object.eModeCategory !== undefined && object.eModeCategory !== null ? EModeCategory.fromPartial(object.eModeCategory) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: NewEModeCategoryEventAmino): NewEModeCategoryEvent { + const message = createBaseNewEModeCategoryEvent(); + if (object.e_mode_category !== undefined && object.e_mode_category !== null) { + message.eModeCategory = EModeCategory.fromAmino(object.e_mode_category); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: NewEModeCategoryEvent, useInterfaces: boolean = false): NewEModeCategoryEventAmino { + const obj: any = {}; + obj.e_mode_category = message.eModeCategory ? EModeCategory.toAmino(message.eModeCategory, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: NewEModeCategoryEventAminoMsg): NewEModeCategoryEvent { + return NewEModeCategoryEvent.fromAmino(object.value); + }, + fromProtoMsg(message: NewEModeCategoryEventProtoMsg, useInterfaces: boolean = false): NewEModeCategoryEvent { + return NewEModeCategoryEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: NewEModeCategoryEvent): Uint8Array { + return NewEModeCategoryEvent.encode(message).finish(); + }, + toProtoMsg(message: NewEModeCategoryEvent): NewEModeCategoryEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.NewEModeCategoryEvent", + value: NewEModeCategoryEvent.encode(message).finish() + }; + } +}; +function createBaseUpdateEModeCategoryEvent(): UpdateEModeCategoryEvent { + return { + eModeCategory: EModeCategory.fromPartial({}), + type: "" + }; +} +export const UpdateEModeCategoryEvent = { + typeUrl: "/Switcheo.carbon.cdp.UpdateEModeCategoryEvent", + encode(message: UpdateEModeCategoryEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eModeCategory !== undefined) { + EModeCategory.encode(message.eModeCategory, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UpdateEModeCategoryEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateEModeCategoryEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eModeCategory = EModeCategory.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateEModeCategoryEvent { + const message = createBaseUpdateEModeCategoryEvent(); + message.eModeCategory = object.eModeCategory !== undefined && object.eModeCategory !== null ? EModeCategory.fromPartial(object.eModeCategory) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: UpdateEModeCategoryEventAmino): UpdateEModeCategoryEvent { + const message = createBaseUpdateEModeCategoryEvent(); + if (object.e_mode_category !== undefined && object.e_mode_category !== null) { + message.eModeCategory = EModeCategory.fromAmino(object.e_mode_category); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: UpdateEModeCategoryEvent, useInterfaces: boolean = false): UpdateEModeCategoryEventAmino { + const obj: any = {}; + obj.e_mode_category = message.eModeCategory ? EModeCategory.toAmino(message.eModeCategory, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: UpdateEModeCategoryEventAminoMsg): UpdateEModeCategoryEvent { + return UpdateEModeCategoryEvent.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateEModeCategoryEventProtoMsg, useInterfaces: boolean = false): UpdateEModeCategoryEvent { + return UpdateEModeCategoryEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UpdateEModeCategoryEvent): Uint8Array { + return UpdateEModeCategoryEvent.encode(message).finish(); + }, + toProtoMsg(message: UpdateEModeCategoryEvent): UpdateEModeCategoryEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.UpdateEModeCategoryEvent", + value: UpdateEModeCategoryEvent.encode(message).finish() + }; + } +}; +function createBaseUpdateAccountEModeCategoryNameEvent(): UpdateAccountEModeCategoryNameEvent { + return { + account: "", + eModeCategoryName: "" + }; +} +export const UpdateAccountEModeCategoryNameEvent = { + typeUrl: "/Switcheo.carbon.cdp.UpdateAccountEModeCategoryNameEvent", + encode(message: UpdateAccountEModeCategoryNameEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + if (message.eModeCategoryName !== "") { + writer.uint32(18).string(message.eModeCategoryName); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UpdateAccountEModeCategoryNameEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateAccountEModeCategoryNameEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.eModeCategoryName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateAccountEModeCategoryNameEvent { + const message = createBaseUpdateAccountEModeCategoryNameEvent(); + message.account = object.account ?? ""; + message.eModeCategoryName = object.eModeCategoryName ?? ""; + return message; + }, + fromAmino(object: UpdateAccountEModeCategoryNameEventAmino): UpdateAccountEModeCategoryNameEvent { + const message = createBaseUpdateAccountEModeCategoryNameEvent(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.e_mode_category_name !== undefined && object.e_mode_category_name !== null) { + message.eModeCategoryName = object.e_mode_category_name; + } + return message; + }, + toAmino(message: UpdateAccountEModeCategoryNameEvent, useInterfaces: boolean = false): UpdateAccountEModeCategoryNameEventAmino { + const obj: any = {}; + obj.account = message.account === "" ? undefined : message.account; + obj.e_mode_category_name = message.eModeCategoryName === "" ? undefined : message.eModeCategoryName; + return obj; + }, + fromAminoMsg(object: UpdateAccountEModeCategoryNameEventAminoMsg): UpdateAccountEModeCategoryNameEvent { + return UpdateAccountEModeCategoryNameEvent.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateAccountEModeCategoryNameEventProtoMsg, useInterfaces: boolean = false): UpdateAccountEModeCategoryNameEvent { + return UpdateAccountEModeCategoryNameEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UpdateAccountEModeCategoryNameEvent): Uint8Array { + return UpdateAccountEModeCategoryNameEvent.encode(message).finish(); + }, + toProtoMsg(message: UpdateAccountEModeCategoryNameEvent): UpdateAccountEModeCategoryNameEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.UpdateAccountEModeCategoryNameEvent", + value: UpdateAccountEModeCategoryNameEvent.encode(message).finish() + }; + } +}; +function createBaseSetInterestFeeEvent(): SetInterestFeeEvent { + return { + interestFee: "", + type: "" + }; +} +export const SetInterestFeeEvent = { + typeUrl: "/Switcheo.carbon.cdp.SetInterestFeeEvent", + encode(message: SetInterestFeeEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.interestFee !== "") { + writer.uint32(10).string(message.interestFee); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SetInterestFeeEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetInterestFeeEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.interestFee = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetInterestFeeEvent { + const message = createBaseSetInterestFeeEvent(); + message.interestFee = object.interestFee ?? ""; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: SetInterestFeeEventAmino): SetInterestFeeEvent { + const message = createBaseSetInterestFeeEvent(); + if (object.interest_fee !== undefined && object.interest_fee !== null) { + message.interestFee = object.interest_fee; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: SetInterestFeeEvent, useInterfaces: boolean = false): SetInterestFeeEventAmino { + const obj: any = {}; + obj.interest_fee = message.interestFee === "" ? undefined : message.interestFee; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: SetInterestFeeEventAminoMsg): SetInterestFeeEvent { + return SetInterestFeeEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetInterestFeeEventProtoMsg, useInterfaces: boolean = false): SetInterestFeeEvent { + return SetInterestFeeEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SetInterestFeeEvent): Uint8Array { + return SetInterestFeeEvent.encode(message).finish(); + }, + toProtoMsg(message: SetInterestFeeEvent): SetInterestFeeEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.SetInterestFeeEvent", + value: SetInterestFeeEvent.encode(message).finish() + }; + } +}; +function createBaseSetLiquidationFeeEvent(): SetLiquidationFeeEvent { + return { + liquidationFee: "", + type: "" + }; +} +export const SetLiquidationFeeEvent = { + typeUrl: "/Switcheo.carbon.cdp.SetLiquidationFeeEvent", + encode(message: SetLiquidationFeeEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidationFee !== "") { + writer.uint32(10).string(message.liquidationFee); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SetLiquidationFeeEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetLiquidationFeeEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidationFee = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetLiquidationFeeEvent { + const message = createBaseSetLiquidationFeeEvent(); + message.liquidationFee = object.liquidationFee ?? ""; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: SetLiquidationFeeEventAmino): SetLiquidationFeeEvent { + const message = createBaseSetLiquidationFeeEvent(); + if (object.liquidation_fee !== undefined && object.liquidation_fee !== null) { + message.liquidationFee = object.liquidation_fee; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: SetLiquidationFeeEvent, useInterfaces: boolean = false): SetLiquidationFeeEventAmino { + const obj: any = {}; + obj.liquidation_fee = message.liquidationFee === "" ? undefined : message.liquidationFee; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: SetLiquidationFeeEventAminoMsg): SetLiquidationFeeEvent { + return SetLiquidationFeeEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetLiquidationFeeEventProtoMsg, useInterfaces: boolean = false): SetLiquidationFeeEvent { + return SetLiquidationFeeEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SetLiquidationFeeEvent): Uint8Array { + return SetLiquidationFeeEvent.encode(message).finish(); + }, + toProtoMsg(message: SetLiquidationFeeEvent): SetLiquidationFeeEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.SetLiquidationFeeEvent", + value: SetLiquidationFeeEvent.encode(message).finish() + }; + } +}; +function createBaseSetStablecoinInterestRateEvent(): SetStablecoinInterestRateEvent { + return { + stablecoinInterestRate: "", + type: "", + stablecoinInterestRateDec: "" + }; +} +export const SetStablecoinInterestRateEvent = { + typeUrl: "/Switcheo.carbon.cdp.SetStablecoinInterestRateEvent", + encode(message: SetStablecoinInterestRateEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stablecoinInterestRate !== "") { + writer.uint32(10).string(message.stablecoinInterestRate); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + if (message.stablecoinInterestRateDec !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.stablecoinInterestRateDec, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SetStablecoinInterestRateEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetStablecoinInterestRateEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stablecoinInterestRate = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + case 3: + message.stablecoinInterestRateDec = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetStablecoinInterestRateEvent { + const message = createBaseSetStablecoinInterestRateEvent(); + message.stablecoinInterestRate = object.stablecoinInterestRate ?? ""; + message.type = object.type ?? ""; + message.stablecoinInterestRateDec = object.stablecoinInterestRateDec ?? ""; + return message; + }, + fromAmino(object: SetStablecoinInterestRateEventAmino): SetStablecoinInterestRateEvent { + const message = createBaseSetStablecoinInterestRateEvent(); + if (object.stablecoin_interest_rate !== undefined && object.stablecoin_interest_rate !== null) { + message.stablecoinInterestRate = object.stablecoin_interest_rate; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.stablecoin_interest_rate_dec !== undefined && object.stablecoin_interest_rate_dec !== null) { + message.stablecoinInterestRateDec = object.stablecoin_interest_rate_dec; + } + return message; + }, + toAmino(message: SetStablecoinInterestRateEvent, useInterfaces: boolean = false): SetStablecoinInterestRateEventAmino { + const obj: any = {}; + obj.stablecoin_interest_rate = message.stablecoinInterestRate === "" ? undefined : message.stablecoinInterestRate; + obj.type = message.type === "" ? undefined : message.type; + obj.stablecoin_interest_rate_dec = message.stablecoinInterestRateDec === "" ? undefined : message.stablecoinInterestRateDec; + return obj; + }, + fromAminoMsg(object: SetStablecoinInterestRateEventAminoMsg): SetStablecoinInterestRateEvent { + return SetStablecoinInterestRateEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetStablecoinInterestRateEventProtoMsg, useInterfaces: boolean = false): SetStablecoinInterestRateEvent { + return SetStablecoinInterestRateEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SetStablecoinInterestRateEvent): Uint8Array { + return SetStablecoinInterestRateEvent.encode(message).finish(); + }, + toProtoMsg(message: SetStablecoinInterestRateEvent): SetStablecoinInterestRateEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.SetStablecoinInterestRateEvent", + value: SetStablecoinInterestRateEvent.encode(message).finish() + }; + } +}; +function createBaseSetStablecoinMintCapEvent(): SetStablecoinMintCapEvent { + return { + stablecoinMintCap: "", + type: "" + }; +} +export const SetStablecoinMintCapEvent = { + typeUrl: "/Switcheo.carbon.cdp.SetStablecoinMintCapEvent", + encode(message: SetStablecoinMintCapEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stablecoinMintCap !== "") { + writer.uint32(10).string(message.stablecoinMintCap); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SetStablecoinMintCapEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetStablecoinMintCapEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stablecoinMintCap = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetStablecoinMintCapEvent { + const message = createBaseSetStablecoinMintCapEvent(); + message.stablecoinMintCap = object.stablecoinMintCap ?? ""; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: SetStablecoinMintCapEventAmino): SetStablecoinMintCapEvent { + const message = createBaseSetStablecoinMintCapEvent(); + if (object.stablecoin_mint_cap !== undefined && object.stablecoin_mint_cap !== null) { + message.stablecoinMintCap = object.stablecoin_mint_cap; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: SetStablecoinMintCapEvent, useInterfaces: boolean = false): SetStablecoinMintCapEventAmino { + const obj: any = {}; + obj.stablecoin_mint_cap = message.stablecoinMintCap === "" ? undefined : message.stablecoinMintCap; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: SetStablecoinMintCapEventAminoMsg): SetStablecoinMintCapEvent { + return SetStablecoinMintCapEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetStablecoinMintCapEventProtoMsg, useInterfaces: boolean = false): SetStablecoinMintCapEvent { + return SetStablecoinMintCapEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SetStablecoinMintCapEvent): Uint8Array { + return SetStablecoinMintCapEvent.encode(message).finish(); + }, + toProtoMsg(message: SetStablecoinMintCapEvent): SetStablecoinMintCapEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.SetStablecoinMintCapEvent", + value: SetStablecoinMintCapEvent.encode(message).finish() + }; + } +}; +function createBaseSetCompleteLiquidationThresholdEvent(): SetCompleteLiquidationThresholdEvent { + return { + completeLiquidationThreshold: "", + type: "" + }; +} +export const SetCompleteLiquidationThresholdEvent = { + typeUrl: "/Switcheo.carbon.cdp.SetCompleteLiquidationThresholdEvent", + encode(message: SetCompleteLiquidationThresholdEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.completeLiquidationThreshold !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.completeLiquidationThreshold, 18).atomics); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SetCompleteLiquidationThresholdEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetCompleteLiquidationThresholdEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completeLiquidationThreshold = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetCompleteLiquidationThresholdEvent { + const message = createBaseSetCompleteLiquidationThresholdEvent(); + message.completeLiquidationThreshold = object.completeLiquidationThreshold ?? ""; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: SetCompleteLiquidationThresholdEventAmino): SetCompleteLiquidationThresholdEvent { + const message = createBaseSetCompleteLiquidationThresholdEvent(); + if (object.complete_liquidation_threshold !== undefined && object.complete_liquidation_threshold !== null) { + message.completeLiquidationThreshold = object.complete_liquidation_threshold; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: SetCompleteLiquidationThresholdEvent, useInterfaces: boolean = false): SetCompleteLiquidationThresholdEventAmino { + const obj: any = {}; + obj.complete_liquidation_threshold = message.completeLiquidationThreshold === "" ? undefined : message.completeLiquidationThreshold; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: SetCompleteLiquidationThresholdEventAminoMsg): SetCompleteLiquidationThresholdEvent { + return SetCompleteLiquidationThresholdEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetCompleteLiquidationThresholdEventProtoMsg, useInterfaces: boolean = false): SetCompleteLiquidationThresholdEvent { + return SetCompleteLiquidationThresholdEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SetCompleteLiquidationThresholdEvent): Uint8Array { + return SetCompleteLiquidationThresholdEvent.encode(message).finish(); + }, + toProtoMsg(message: SetCompleteLiquidationThresholdEvent): SetCompleteLiquidationThresholdEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.SetCompleteLiquidationThresholdEvent", + value: SetCompleteLiquidationThresholdEvent.encode(message).finish() + }; + } +}; +function createBaseSetMinimumCloseFactorEvent(): SetMinimumCloseFactorEvent { + return { + minimumCloseFactor: "", + type: "" + }; +} +export const SetMinimumCloseFactorEvent = { + typeUrl: "/Switcheo.carbon.cdp.SetMinimumCloseFactorEvent", + encode(message: SetMinimumCloseFactorEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.minimumCloseFactor !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.minimumCloseFactor, 18).atomics); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SetMinimumCloseFactorEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetMinimumCloseFactorEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minimumCloseFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetMinimumCloseFactorEvent { + const message = createBaseSetMinimumCloseFactorEvent(); + message.minimumCloseFactor = object.minimumCloseFactor ?? ""; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: SetMinimumCloseFactorEventAmino): SetMinimumCloseFactorEvent { + const message = createBaseSetMinimumCloseFactorEvent(); + if (object.minimum_close_factor !== undefined && object.minimum_close_factor !== null) { + message.minimumCloseFactor = object.minimum_close_factor; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: SetMinimumCloseFactorEvent, useInterfaces: boolean = false): SetMinimumCloseFactorEventAmino { + const obj: any = {}; + obj.minimum_close_factor = message.minimumCloseFactor === "" ? undefined : message.minimumCloseFactor; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: SetMinimumCloseFactorEventAminoMsg): SetMinimumCloseFactorEvent { + return SetMinimumCloseFactorEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetMinimumCloseFactorEventProtoMsg, useInterfaces: boolean = false): SetMinimumCloseFactorEvent { + return SetMinimumCloseFactorEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SetMinimumCloseFactorEvent): Uint8Array { + return SetMinimumCloseFactorEvent.encode(message).finish(); + }, + toProtoMsg(message: SetMinimumCloseFactorEvent): SetMinimumCloseFactorEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.SetMinimumCloseFactorEvent", + value: SetMinimumCloseFactorEvent.encode(message).finish() + }; + } +}; +function createBaseSetSmallLiquidationSizeEvent(): SetSmallLiquidationSizeEvent { + return { + smallLiquidationSize: "", + type: "" + }; +} +export const SetSmallLiquidationSizeEvent = { + typeUrl: "/Switcheo.carbon.cdp.SetSmallLiquidationSizeEvent", + encode(message: SetSmallLiquidationSizeEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.smallLiquidationSize !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.smallLiquidationSize, 18).atomics); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SetSmallLiquidationSizeEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetSmallLiquidationSizeEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.smallLiquidationSize = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetSmallLiquidationSizeEvent { + const message = createBaseSetSmallLiquidationSizeEvent(); + message.smallLiquidationSize = object.smallLiquidationSize ?? ""; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: SetSmallLiquidationSizeEventAmino): SetSmallLiquidationSizeEvent { + const message = createBaseSetSmallLiquidationSizeEvent(); + if (object.small_liquidation_size !== undefined && object.small_liquidation_size !== null) { + message.smallLiquidationSize = object.small_liquidation_size; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: SetSmallLiquidationSizeEvent, useInterfaces: boolean = false): SetSmallLiquidationSizeEventAmino { + const obj: any = {}; + obj.small_liquidation_size = message.smallLiquidationSize === "" ? undefined : message.smallLiquidationSize; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: SetSmallLiquidationSizeEventAminoMsg): SetSmallLiquidationSizeEvent { + return SetSmallLiquidationSizeEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetSmallLiquidationSizeEventProtoMsg, useInterfaces: boolean = false): SetSmallLiquidationSizeEvent { + return SetSmallLiquidationSizeEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SetSmallLiquidationSizeEvent): Uint8Array { + return SetSmallLiquidationSizeEvent.encode(message).finish(); + }, + toProtoMsg(message: SetSmallLiquidationSizeEvent): SetSmallLiquidationSizeEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.SetSmallLiquidationSizeEvent", + value: SetSmallLiquidationSizeEvent.encode(message).finish() + }; + } +}; +function createBaseSetStalePriceGracePeriodEvent(): SetStalePriceGracePeriodEvent { + return { + stalePriceGracePeriod: Duration.fromPartial({}), + type: "" + }; +} +export const SetStalePriceGracePeriodEvent = { + typeUrl: "/Switcheo.carbon.cdp.SetStalePriceGracePeriodEvent", + encode(message: SetStalePriceGracePeriodEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stalePriceGracePeriod !== undefined) { + Duration.encode(message.stalePriceGracePeriod, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SetStalePriceGracePeriodEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetStalePriceGracePeriodEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stalePriceGracePeriod = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetStalePriceGracePeriodEvent { + const message = createBaseSetStalePriceGracePeriodEvent(); + message.stalePriceGracePeriod = object.stalePriceGracePeriod !== undefined && object.stalePriceGracePeriod !== null ? Duration.fromPartial(object.stalePriceGracePeriod) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: SetStalePriceGracePeriodEventAmino): SetStalePriceGracePeriodEvent { + const message = createBaseSetStalePriceGracePeriodEvent(); + if (object.stale_price_grace_period !== undefined && object.stale_price_grace_period !== null) { + message.stalePriceGracePeriod = Duration.fromAmino(object.stale_price_grace_period); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: SetStalePriceGracePeriodEvent, useInterfaces: boolean = false): SetStalePriceGracePeriodEventAmino { + const obj: any = {}; + obj.stale_price_grace_period = message.stalePriceGracePeriod ? Duration.toAmino(message.stalePriceGracePeriod, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: SetStalePriceGracePeriodEventAminoMsg): SetStalePriceGracePeriodEvent { + return SetStalePriceGracePeriodEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetStalePriceGracePeriodEventProtoMsg, useInterfaces: boolean = false): SetStalePriceGracePeriodEvent { + return SetStalePriceGracePeriodEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SetStalePriceGracePeriodEvent): Uint8Array { + return SetStalePriceGracePeriodEvent.encode(message).finish(); + }, + toProtoMsg(message: SetStalePriceGracePeriodEvent): SetStalePriceGracePeriodEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.SetStalePriceGracePeriodEvent", + value: SetStalePriceGracePeriodEvent.encode(message).finish() + }; + } +}; +function createBaseSetCdpPausedEvent(): SetCdpPausedEvent { + return { + cdpPaused: false, + type: "" + }; +} +export const SetCdpPausedEvent = { + typeUrl: "/Switcheo.carbon.cdp.SetCdpPausedEvent", + encode(message: SetCdpPausedEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.cdpPaused === true) { + writer.uint32(8).bool(message.cdpPaused); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SetCdpPausedEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetCdpPausedEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cdpPaused = reader.bool(); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetCdpPausedEvent { + const message = createBaseSetCdpPausedEvent(); + message.cdpPaused = object.cdpPaused ?? false; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: SetCdpPausedEventAmino): SetCdpPausedEvent { + const message = createBaseSetCdpPausedEvent(); + if (object.cdp_paused !== undefined && object.cdp_paused !== null) { + message.cdpPaused = object.cdp_paused; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: SetCdpPausedEvent, useInterfaces: boolean = false): SetCdpPausedEventAmino { + const obj: any = {}; + obj.cdp_paused = message.cdpPaused === false ? undefined : message.cdpPaused; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: SetCdpPausedEventAminoMsg): SetCdpPausedEvent { + return SetCdpPausedEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SetCdpPausedEventProtoMsg, useInterfaces: boolean = false): SetCdpPausedEvent { + return SetCdpPausedEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SetCdpPausedEvent): Uint8Array { + return SetCdpPausedEvent.encode(message).finish(); + }, + toProtoMsg(message: SetCdpPausedEvent): SetCdpPausedEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.SetCdpPausedEvent", + value: SetCdpPausedEvent.encode(message).finish() + }; + } +}; +function createBaseSupplyAssetEvent(): SupplyAssetEvent { + return { + supplier: "", + denom: "", + amountSupplied: "", + cibtDenom: "", + amountMinted: "" + }; +} +export const SupplyAssetEvent = { + typeUrl: "/Switcheo.carbon.cdp.SupplyAssetEvent", + encode(message: SupplyAssetEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.supplier !== "") { + writer.uint32(10).string(message.supplier); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.amountSupplied !== "") { + writer.uint32(26).string(message.amountSupplied); + } + if (message.cibtDenom !== "") { + writer.uint32(34).string(message.cibtDenom); + } + if (message.amountMinted !== "") { + writer.uint32(42).string(message.amountMinted); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SupplyAssetEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSupplyAssetEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.supplier = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.amountSupplied = reader.string(); + break; + case 4: + message.cibtDenom = reader.string(); + break; + case 5: + message.amountMinted = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SupplyAssetEvent { + const message = createBaseSupplyAssetEvent(); + message.supplier = object.supplier ?? ""; + message.denom = object.denom ?? ""; + message.amountSupplied = object.amountSupplied ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + message.amountMinted = object.amountMinted ?? ""; + return message; + }, + fromAmino(object: SupplyAssetEventAmino): SupplyAssetEvent { + const message = createBaseSupplyAssetEvent(); + if (object.supplier !== undefined && object.supplier !== null) { + message.supplier = object.supplier; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount_supplied !== undefined && object.amount_supplied !== null) { + message.amountSupplied = object.amount_supplied; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + if (object.amount_minted !== undefined && object.amount_minted !== null) { + message.amountMinted = object.amount_minted; + } + return message; + }, + toAmino(message: SupplyAssetEvent, useInterfaces: boolean = false): SupplyAssetEventAmino { + const obj: any = {}; + obj.supplier = message.supplier === "" ? undefined : message.supplier; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount_supplied = message.amountSupplied === "" ? undefined : message.amountSupplied; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + obj.amount_minted = message.amountMinted === "" ? undefined : message.amountMinted; + return obj; + }, + fromAminoMsg(object: SupplyAssetEventAminoMsg): SupplyAssetEvent { + return SupplyAssetEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SupplyAssetEventProtoMsg, useInterfaces: boolean = false): SupplyAssetEvent { + return SupplyAssetEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SupplyAssetEvent): Uint8Array { + return SupplyAssetEvent.encode(message).finish(); + }, + toProtoMsg(message: SupplyAssetEvent): SupplyAssetEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.SupplyAssetEvent", + value: SupplyAssetEvent.encode(message).finish() + }; + } +}; +function createBaseWithdrawAssetEvent(): WithdrawAssetEvent { + return { + withdrawer: "", + denom: "", + amountWithdrawed: "", + cibtDenom: "", + amountBurned: "" + }; +} +export const WithdrawAssetEvent = { + typeUrl: "/Switcheo.carbon.cdp.WithdrawAssetEvent", + encode(message: WithdrawAssetEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.withdrawer !== "") { + writer.uint32(10).string(message.withdrawer); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.amountWithdrawed !== "") { + writer.uint32(26).string(message.amountWithdrawed); + } + if (message.cibtDenom !== "") { + writer.uint32(34).string(message.cibtDenom); + } + if (message.amountBurned !== "") { + writer.uint32(42).string(message.amountBurned); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): WithdrawAssetEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWithdrawAssetEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.withdrawer = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.amountWithdrawed = reader.string(); + break; + case 4: + message.cibtDenom = reader.string(); + break; + case 5: + message.amountBurned = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): WithdrawAssetEvent { + const message = createBaseWithdrawAssetEvent(); + message.withdrawer = object.withdrawer ?? ""; + message.denom = object.denom ?? ""; + message.amountWithdrawed = object.amountWithdrawed ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + message.amountBurned = object.amountBurned ?? ""; + return message; + }, + fromAmino(object: WithdrawAssetEventAmino): WithdrawAssetEvent { + const message = createBaseWithdrawAssetEvent(); + if (object.withdrawer !== undefined && object.withdrawer !== null) { + message.withdrawer = object.withdrawer; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount_withdrawed !== undefined && object.amount_withdrawed !== null) { + message.amountWithdrawed = object.amount_withdrawed; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + if (object.amount_burned !== undefined && object.amount_burned !== null) { + message.amountBurned = object.amount_burned; + } + return message; + }, + toAmino(message: WithdrawAssetEvent, useInterfaces: boolean = false): WithdrawAssetEventAmino { + const obj: any = {}; + obj.withdrawer = message.withdrawer === "" ? undefined : message.withdrawer; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount_withdrawed = message.amountWithdrawed === "" ? undefined : message.amountWithdrawed; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + obj.amount_burned = message.amountBurned === "" ? undefined : message.amountBurned; + return obj; + }, + fromAminoMsg(object: WithdrawAssetEventAminoMsg): WithdrawAssetEvent { + return WithdrawAssetEvent.fromAmino(object.value); + }, + fromProtoMsg(message: WithdrawAssetEventProtoMsg, useInterfaces: boolean = false): WithdrawAssetEvent { + return WithdrawAssetEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: WithdrawAssetEvent): Uint8Array { + return WithdrawAssetEvent.encode(message).finish(); + }, + toProtoMsg(message: WithdrawAssetEvent): WithdrawAssetEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.WithdrawAssetEvent", + value: WithdrawAssetEvent.encode(message).finish() + }; + } +}; +function createBaseBorrowAssetEvent(): BorrowAssetEvent { + return { + borrower: "", + denom: "", + amountBorrowed: "", + debtValue: "", + collateralValue: "", + initialCumulativeInterestMultiplier: "" + }; +} +export const BorrowAssetEvent = { + typeUrl: "/Switcheo.carbon.cdp.BorrowAssetEvent", + encode(message: BorrowAssetEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.borrower !== "") { + writer.uint32(10).string(message.borrower); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.amountBorrowed !== "") { + writer.uint32(26).string(message.amountBorrowed); + } + if (message.debtValue !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.debtValue, 18).atomics); + } + if (message.collateralValue !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.collateralValue, 18).atomics); + } + if (message.initialCumulativeInterestMultiplier !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.initialCumulativeInterestMultiplier, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): BorrowAssetEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBorrowAssetEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.borrower = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.amountBorrowed = reader.string(); + break; + case 4: + message.debtValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.collateralValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.initialCumulativeInterestMultiplier = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BorrowAssetEvent { + const message = createBaseBorrowAssetEvent(); + message.borrower = object.borrower ?? ""; + message.denom = object.denom ?? ""; + message.amountBorrowed = object.amountBorrowed ?? ""; + message.debtValue = object.debtValue ?? ""; + message.collateralValue = object.collateralValue ?? ""; + message.initialCumulativeInterestMultiplier = object.initialCumulativeInterestMultiplier ?? ""; + return message; + }, + fromAmino(object: BorrowAssetEventAmino): BorrowAssetEvent { + const message = createBaseBorrowAssetEvent(); + if (object.borrower !== undefined && object.borrower !== null) { + message.borrower = object.borrower; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount_borrowed !== undefined && object.amount_borrowed !== null) { + message.amountBorrowed = object.amount_borrowed; + } + if (object.debt_value !== undefined && object.debt_value !== null) { + message.debtValue = object.debt_value; + } + if (object.collateral_value !== undefined && object.collateral_value !== null) { + message.collateralValue = object.collateral_value; + } + if (object.initial_cumulative_interest_multiplier !== undefined && object.initial_cumulative_interest_multiplier !== null) { + message.initialCumulativeInterestMultiplier = object.initial_cumulative_interest_multiplier; + } + return message; + }, + toAmino(message: BorrowAssetEvent, useInterfaces: boolean = false): BorrowAssetEventAmino { + const obj: any = {}; + obj.borrower = message.borrower === "" ? undefined : message.borrower; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount_borrowed = message.amountBorrowed === "" ? undefined : message.amountBorrowed; + obj.debt_value = message.debtValue === "" ? undefined : message.debtValue; + obj.collateral_value = message.collateralValue === "" ? undefined : message.collateralValue; + obj.initial_cumulative_interest_multiplier = message.initialCumulativeInterestMultiplier === "" ? undefined : message.initialCumulativeInterestMultiplier; + return obj; + }, + fromAminoMsg(object: BorrowAssetEventAminoMsg): BorrowAssetEvent { + return BorrowAssetEvent.fromAmino(object.value); + }, + fromProtoMsg(message: BorrowAssetEventProtoMsg, useInterfaces: boolean = false): BorrowAssetEvent { + return BorrowAssetEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: BorrowAssetEvent): Uint8Array { + return BorrowAssetEvent.encode(message).finish(); + }, + toProtoMsg(message: BorrowAssetEvent): BorrowAssetEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.BorrowAssetEvent", + value: BorrowAssetEvent.encode(message).finish() + }; + } +}; +function createBaseRepayAssetEvent(): RepayAssetEvent { + return { + repayer: "", + debtor: "", + denom: "", + principalRepaid: "", + interestRepaid: "", + debtValue: "", + collateralValue: "" + }; +} +export const RepayAssetEvent = { + typeUrl: "/Switcheo.carbon.cdp.RepayAssetEvent", + encode(message: RepayAssetEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.repayer !== "") { + writer.uint32(10).string(message.repayer); + } + if (message.debtor !== "") { + writer.uint32(18).string(message.debtor); + } + if (message.denom !== "") { + writer.uint32(26).string(message.denom); + } + if (message.principalRepaid !== "") { + writer.uint32(34).string(message.principalRepaid); + } + if (message.interestRepaid !== "") { + writer.uint32(42).string(message.interestRepaid); + } + if (message.debtValue !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.debtValue, 18).atomics); + } + if (message.collateralValue !== "") { + writer.uint32(58).string(Decimal.fromUserInput(message.collateralValue, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RepayAssetEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRepayAssetEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.repayer = reader.string(); + break; + case 2: + message.debtor = reader.string(); + break; + case 3: + message.denom = reader.string(); + break; + case 4: + message.principalRepaid = reader.string(); + break; + case 5: + message.interestRepaid = reader.string(); + break; + case 6: + message.debtValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.collateralValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RepayAssetEvent { + const message = createBaseRepayAssetEvent(); + message.repayer = object.repayer ?? ""; + message.debtor = object.debtor ?? ""; + message.denom = object.denom ?? ""; + message.principalRepaid = object.principalRepaid ?? ""; + message.interestRepaid = object.interestRepaid ?? ""; + message.debtValue = object.debtValue ?? ""; + message.collateralValue = object.collateralValue ?? ""; + return message; + }, + fromAmino(object: RepayAssetEventAmino): RepayAssetEvent { + const message = createBaseRepayAssetEvent(); + if (object.repayer !== undefined && object.repayer !== null) { + message.repayer = object.repayer; + } + if (object.debtor !== undefined && object.debtor !== null) { + message.debtor = object.debtor; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.principal_repaid !== undefined && object.principal_repaid !== null) { + message.principalRepaid = object.principal_repaid; + } + if (object.interest_repaid !== undefined && object.interest_repaid !== null) { + message.interestRepaid = object.interest_repaid; + } + if (object.debt_value !== undefined && object.debt_value !== null) { + message.debtValue = object.debt_value; + } + if (object.collateral_value !== undefined && object.collateral_value !== null) { + message.collateralValue = object.collateral_value; + } + return message; + }, + toAmino(message: RepayAssetEvent, useInterfaces: boolean = false): RepayAssetEventAmino { + const obj: any = {}; + obj.repayer = message.repayer === "" ? undefined : message.repayer; + obj.debtor = message.debtor === "" ? undefined : message.debtor; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.principal_repaid = message.principalRepaid === "" ? undefined : message.principalRepaid; + obj.interest_repaid = message.interestRepaid === "" ? undefined : message.interestRepaid; + obj.debt_value = message.debtValue === "" ? undefined : message.debtValue; + obj.collateral_value = message.collateralValue === "" ? undefined : message.collateralValue; + return obj; + }, + fromAminoMsg(object: RepayAssetEventAminoMsg): RepayAssetEvent { + return RepayAssetEvent.fromAmino(object.value); + }, + fromProtoMsg(message: RepayAssetEventProtoMsg, useInterfaces: boolean = false): RepayAssetEvent { + return RepayAssetEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RepayAssetEvent): Uint8Array { + return RepayAssetEvent.encode(message).finish(); + }, + toProtoMsg(message: RepayAssetEvent): RepayAssetEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.RepayAssetEvent", + value: RepayAssetEvent.encode(message).finish() + }; + } +}; +function createBaseLockCollateralEvent(): LockCollateralEvent { + return { + locker: "", + cibtDenom: "", + amountLocked: "", + debtValue: "", + collateralValue: "" + }; +} +export const LockCollateralEvent = { + typeUrl: "/Switcheo.carbon.cdp.LockCollateralEvent", + encode(message: LockCollateralEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.locker !== "") { + writer.uint32(10).string(message.locker); + } + if (message.cibtDenom !== "") { + writer.uint32(18).string(message.cibtDenom); + } + if (message.amountLocked !== "") { + writer.uint32(26).string(message.amountLocked); + } + if (message.debtValue !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.debtValue, 18).atomics); + } + if (message.collateralValue !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.collateralValue, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): LockCollateralEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockCollateralEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locker = reader.string(); + break; + case 2: + message.cibtDenom = reader.string(); + break; + case 3: + message.amountLocked = reader.string(); + break; + case 4: + message.debtValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.collateralValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LockCollateralEvent { + const message = createBaseLockCollateralEvent(); + message.locker = object.locker ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + message.amountLocked = object.amountLocked ?? ""; + message.debtValue = object.debtValue ?? ""; + message.collateralValue = object.collateralValue ?? ""; + return message; + }, + fromAmino(object: LockCollateralEventAmino): LockCollateralEvent { + const message = createBaseLockCollateralEvent(); + if (object.locker !== undefined && object.locker !== null) { + message.locker = object.locker; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + if (object.amount_locked !== undefined && object.amount_locked !== null) { + message.amountLocked = object.amount_locked; + } + if (object.debt_value !== undefined && object.debt_value !== null) { + message.debtValue = object.debt_value; + } + if (object.collateral_value !== undefined && object.collateral_value !== null) { + message.collateralValue = object.collateral_value; + } + return message; + }, + toAmino(message: LockCollateralEvent, useInterfaces: boolean = false): LockCollateralEventAmino { + const obj: any = {}; + obj.locker = message.locker === "" ? undefined : message.locker; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + obj.amount_locked = message.amountLocked === "" ? undefined : message.amountLocked; + obj.debt_value = message.debtValue === "" ? undefined : message.debtValue; + obj.collateral_value = message.collateralValue === "" ? undefined : message.collateralValue; + return obj; + }, + fromAminoMsg(object: LockCollateralEventAminoMsg): LockCollateralEvent { + return LockCollateralEvent.fromAmino(object.value); + }, + fromProtoMsg(message: LockCollateralEventProtoMsg, useInterfaces: boolean = false): LockCollateralEvent { + return LockCollateralEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: LockCollateralEvent): Uint8Array { + return LockCollateralEvent.encode(message).finish(); + }, + toProtoMsg(message: LockCollateralEvent): LockCollateralEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.LockCollateralEvent", + value: LockCollateralEvent.encode(message).finish() + }; + } +}; +function createBaseUnlockCollateralEvent(): UnlockCollateralEvent { + return { + unlocker: "", + cibtDenom: "", + amountUnlocked: "", + debtValue: "", + collateralValue: "" + }; +} +export const UnlockCollateralEvent = { + typeUrl: "/Switcheo.carbon.cdp.UnlockCollateralEvent", + encode(message: UnlockCollateralEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unlocker !== "") { + writer.uint32(10).string(message.unlocker); + } + if (message.cibtDenom !== "") { + writer.uint32(18).string(message.cibtDenom); + } + if (message.amountUnlocked !== "") { + writer.uint32(26).string(message.amountUnlocked); + } + if (message.debtValue !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.debtValue, 18).atomics); + } + if (message.collateralValue !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.collateralValue, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UnlockCollateralEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnlockCollateralEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unlocker = reader.string(); + break; + case 2: + message.cibtDenom = reader.string(); + break; + case 3: + message.amountUnlocked = reader.string(); + break; + case 4: + message.debtValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.collateralValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UnlockCollateralEvent { + const message = createBaseUnlockCollateralEvent(); + message.unlocker = object.unlocker ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + message.amountUnlocked = object.amountUnlocked ?? ""; + message.debtValue = object.debtValue ?? ""; + message.collateralValue = object.collateralValue ?? ""; + return message; + }, + fromAmino(object: UnlockCollateralEventAmino): UnlockCollateralEvent { + const message = createBaseUnlockCollateralEvent(); + if (object.unlocker !== undefined && object.unlocker !== null) { + message.unlocker = object.unlocker; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + if (object.amount_unlocked !== undefined && object.amount_unlocked !== null) { + message.amountUnlocked = object.amount_unlocked; + } + if (object.debt_value !== undefined && object.debt_value !== null) { + message.debtValue = object.debt_value; + } + if (object.collateral_value !== undefined && object.collateral_value !== null) { + message.collateralValue = object.collateral_value; + } + return message; + }, + toAmino(message: UnlockCollateralEvent, useInterfaces: boolean = false): UnlockCollateralEventAmino { + const obj: any = {}; + obj.unlocker = message.unlocker === "" ? undefined : message.unlocker; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + obj.amount_unlocked = message.amountUnlocked === "" ? undefined : message.amountUnlocked; + obj.debt_value = message.debtValue === "" ? undefined : message.debtValue; + obj.collateral_value = message.collateralValue === "" ? undefined : message.collateralValue; + return obj; + }, + fromAminoMsg(object: UnlockCollateralEventAminoMsg): UnlockCollateralEvent { + return UnlockCollateralEvent.fromAmino(object.value); + }, + fromProtoMsg(message: UnlockCollateralEventProtoMsg, useInterfaces: boolean = false): UnlockCollateralEvent { + return UnlockCollateralEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UnlockCollateralEvent): Uint8Array { + return UnlockCollateralEvent.encode(message).finish(); + }, + toProtoMsg(message: UnlockCollateralEvent): UnlockCollateralEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.UnlockCollateralEvent", + value: UnlockCollateralEvent.encode(message).finish() + }; + } +}; +function createBaseUpdateDebtInfoEvent(): UpdateDebtInfoEvent { + return { + debtInfo: DebtInfo.fromPartial({}), + type: "" + }; +} +export const UpdateDebtInfoEvent = { + typeUrl: "/Switcheo.carbon.cdp.UpdateDebtInfoEvent", + encode(message: UpdateDebtInfoEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.debtInfo !== undefined) { + DebtInfo.encode(message.debtInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UpdateDebtInfoEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateDebtInfoEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.debtInfo = DebtInfo.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateDebtInfoEvent { + const message = createBaseUpdateDebtInfoEvent(); + message.debtInfo = object.debtInfo !== undefined && object.debtInfo !== null ? DebtInfo.fromPartial(object.debtInfo) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: UpdateDebtInfoEventAmino): UpdateDebtInfoEvent { + const message = createBaseUpdateDebtInfoEvent(); + if (object.debt_info !== undefined && object.debt_info !== null) { + message.debtInfo = DebtInfo.fromAmino(object.debt_info); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: UpdateDebtInfoEvent, useInterfaces: boolean = false): UpdateDebtInfoEventAmino { + const obj: any = {}; + obj.debt_info = message.debtInfo ? DebtInfo.toAmino(message.debtInfo, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: UpdateDebtInfoEventAminoMsg): UpdateDebtInfoEvent { + return UpdateDebtInfoEvent.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateDebtInfoEventProtoMsg, useInterfaces: boolean = false): UpdateDebtInfoEvent { + return UpdateDebtInfoEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UpdateDebtInfoEvent): Uint8Array { + return UpdateDebtInfoEvent.encode(message).finish(); + }, + toProtoMsg(message: UpdateDebtInfoEvent): UpdateDebtInfoEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.UpdateDebtInfoEvent", + value: UpdateDebtInfoEvent.encode(message).finish() + }; + } +}; +function createBaseUpdateStablecoinDebtInfoEvent(): UpdateStablecoinDebtInfoEvent { + return { + stablecoinDebtInfo: StablecoinDebtInfo.fromPartial({}), + type: "" + }; +} +export const UpdateStablecoinDebtInfoEvent = { + typeUrl: "/Switcheo.carbon.cdp.UpdateStablecoinDebtInfoEvent", + encode(message: UpdateStablecoinDebtInfoEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stablecoinDebtInfo !== undefined) { + StablecoinDebtInfo.encode(message.stablecoinDebtInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UpdateStablecoinDebtInfoEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateStablecoinDebtInfoEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stablecoinDebtInfo = StablecoinDebtInfo.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateStablecoinDebtInfoEvent { + const message = createBaseUpdateStablecoinDebtInfoEvent(); + message.stablecoinDebtInfo = object.stablecoinDebtInfo !== undefined && object.stablecoinDebtInfo !== null ? StablecoinDebtInfo.fromPartial(object.stablecoinDebtInfo) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: UpdateStablecoinDebtInfoEventAmino): UpdateStablecoinDebtInfoEvent { + const message = createBaseUpdateStablecoinDebtInfoEvent(); + if (object.stablecoin_debt_info !== undefined && object.stablecoin_debt_info !== null) { + message.stablecoinDebtInfo = StablecoinDebtInfo.fromAmino(object.stablecoin_debt_info); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: UpdateStablecoinDebtInfoEvent, useInterfaces: boolean = false): UpdateStablecoinDebtInfoEventAmino { + const obj: any = {}; + obj.stablecoin_debt_info = message.stablecoinDebtInfo ? StablecoinDebtInfo.toAmino(message.stablecoinDebtInfo, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: UpdateStablecoinDebtInfoEventAminoMsg): UpdateStablecoinDebtInfoEvent { + return UpdateStablecoinDebtInfoEvent.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateStablecoinDebtInfoEventProtoMsg, useInterfaces: boolean = false): UpdateStablecoinDebtInfoEvent { + return UpdateStablecoinDebtInfoEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UpdateStablecoinDebtInfoEvent): Uint8Array { + return UpdateStablecoinDebtInfoEvent.encode(message).finish(); + }, + toProtoMsg(message: UpdateStablecoinDebtInfoEvent): UpdateStablecoinDebtInfoEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.UpdateStablecoinDebtInfoEvent", + value: UpdateStablecoinDebtInfoEvent.encode(message).finish() + }; + } +}; +function createBaseMintStablecoinEvent(): MintStablecoinEvent { + return { + minter: "", + denom: "", + amountMinted: "", + debtValue: "", + collateralValue: "", + initialCumulativeInterestMultiplier: "" + }; +} +export const MintStablecoinEvent = { + typeUrl: "/Switcheo.carbon.cdp.MintStablecoinEvent", + encode(message: MintStablecoinEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.minter !== "") { + writer.uint32(10).string(message.minter); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.amountMinted !== "") { + writer.uint32(26).string(message.amountMinted); + } + if (message.debtValue !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.debtValue, 18).atomics); + } + if (message.collateralValue !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.collateralValue, 18).atomics); + } + if (message.initialCumulativeInterestMultiplier !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.initialCumulativeInterestMultiplier, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MintStablecoinEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMintStablecoinEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minter = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.amountMinted = reader.string(); + break; + case 4: + message.debtValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.collateralValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.initialCumulativeInterestMultiplier = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MintStablecoinEvent { + const message = createBaseMintStablecoinEvent(); + message.minter = object.minter ?? ""; + message.denom = object.denom ?? ""; + message.amountMinted = object.amountMinted ?? ""; + message.debtValue = object.debtValue ?? ""; + message.collateralValue = object.collateralValue ?? ""; + message.initialCumulativeInterestMultiplier = object.initialCumulativeInterestMultiplier ?? ""; + return message; + }, + fromAmino(object: MintStablecoinEventAmino): MintStablecoinEvent { + const message = createBaseMintStablecoinEvent(); + if (object.minter !== undefined && object.minter !== null) { + message.minter = object.minter; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount_minted !== undefined && object.amount_minted !== null) { + message.amountMinted = object.amount_minted; + } + if (object.debt_value !== undefined && object.debt_value !== null) { + message.debtValue = object.debt_value; + } + if (object.collateral_value !== undefined && object.collateral_value !== null) { + message.collateralValue = object.collateral_value; + } + if (object.initial_cumulative_interest_multiplier !== undefined && object.initial_cumulative_interest_multiplier !== null) { + message.initialCumulativeInterestMultiplier = object.initial_cumulative_interest_multiplier; + } + return message; + }, + toAmino(message: MintStablecoinEvent, useInterfaces: boolean = false): MintStablecoinEventAmino { + const obj: any = {}; + obj.minter = message.minter === "" ? undefined : message.minter; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount_minted = message.amountMinted === "" ? undefined : message.amountMinted; + obj.debt_value = message.debtValue === "" ? undefined : message.debtValue; + obj.collateral_value = message.collateralValue === "" ? undefined : message.collateralValue; + obj.initial_cumulative_interest_multiplier = message.initialCumulativeInterestMultiplier === "" ? undefined : message.initialCumulativeInterestMultiplier; + return obj; + }, + fromAminoMsg(object: MintStablecoinEventAminoMsg): MintStablecoinEvent { + return MintStablecoinEvent.fromAmino(object.value); + }, + fromProtoMsg(message: MintStablecoinEventProtoMsg, useInterfaces: boolean = false): MintStablecoinEvent { + return MintStablecoinEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MintStablecoinEvent): Uint8Array { + return MintStablecoinEvent.encode(message).finish(); + }, + toProtoMsg(message: MintStablecoinEvent): MintStablecoinEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MintStablecoinEvent", + value: MintStablecoinEvent.encode(message).finish() + }; + } +}; +function createBaseReturnStablecoinEvent(): ReturnStablecoinEvent { + return { + returner: "", + debtor: "", + interestDenom: "", + interestRepaid: "", + principalRepaid: "", + debtValue: "", + collateralValue: "" + }; +} +export const ReturnStablecoinEvent = { + typeUrl: "/Switcheo.carbon.cdp.ReturnStablecoinEvent", + encode(message: ReturnStablecoinEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.returner !== "") { + writer.uint32(10).string(message.returner); + } + if (message.debtor !== "") { + writer.uint32(18).string(message.debtor); + } + if (message.interestDenom !== "") { + writer.uint32(26).string(message.interestDenom); + } + if (message.interestRepaid !== "") { + writer.uint32(34).string(message.interestRepaid); + } + if (message.principalRepaid !== "") { + writer.uint32(42).string(message.principalRepaid); + } + if (message.debtValue !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.debtValue, 18).atomics); + } + if (message.collateralValue !== "") { + writer.uint32(58).string(Decimal.fromUserInput(message.collateralValue, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ReturnStablecoinEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReturnStablecoinEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.returner = reader.string(); + break; + case 2: + message.debtor = reader.string(); + break; + case 3: + message.interestDenom = reader.string(); + break; + case 4: + message.interestRepaid = reader.string(); + break; + case 5: + message.principalRepaid = reader.string(); + break; + case 6: + message.debtValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.collateralValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ReturnStablecoinEvent { + const message = createBaseReturnStablecoinEvent(); + message.returner = object.returner ?? ""; + message.debtor = object.debtor ?? ""; + message.interestDenom = object.interestDenom ?? ""; + message.interestRepaid = object.interestRepaid ?? ""; + message.principalRepaid = object.principalRepaid ?? ""; + message.debtValue = object.debtValue ?? ""; + message.collateralValue = object.collateralValue ?? ""; + return message; + }, + fromAmino(object: ReturnStablecoinEventAmino): ReturnStablecoinEvent { + const message = createBaseReturnStablecoinEvent(); + if (object.returner !== undefined && object.returner !== null) { + message.returner = object.returner; + } + if (object.debtor !== undefined && object.debtor !== null) { + message.debtor = object.debtor; + } + if (object.interest_denom !== undefined && object.interest_denom !== null) { + message.interestDenom = object.interest_denom; + } + if (object.interest_repaid !== undefined && object.interest_repaid !== null) { + message.interestRepaid = object.interest_repaid; + } + if (object.principal_repaid !== undefined && object.principal_repaid !== null) { + message.principalRepaid = object.principal_repaid; + } + if (object.debt_value !== undefined && object.debt_value !== null) { + message.debtValue = object.debt_value; + } + if (object.collateral_value !== undefined && object.collateral_value !== null) { + message.collateralValue = object.collateral_value; + } + return message; + }, + toAmino(message: ReturnStablecoinEvent, useInterfaces: boolean = false): ReturnStablecoinEventAmino { + const obj: any = {}; + obj.returner = message.returner === "" ? undefined : message.returner; + obj.debtor = message.debtor === "" ? undefined : message.debtor; + obj.interest_denom = message.interestDenom === "" ? undefined : message.interestDenom; + obj.interest_repaid = message.interestRepaid === "" ? undefined : message.interestRepaid; + obj.principal_repaid = message.principalRepaid === "" ? undefined : message.principalRepaid; + obj.debt_value = message.debtValue === "" ? undefined : message.debtValue; + obj.collateral_value = message.collateralValue === "" ? undefined : message.collateralValue; + return obj; + }, + fromAminoMsg(object: ReturnStablecoinEventAminoMsg): ReturnStablecoinEvent { + return ReturnStablecoinEvent.fromAmino(object.value); + }, + fromProtoMsg(message: ReturnStablecoinEventProtoMsg, useInterfaces: boolean = false): ReturnStablecoinEvent { + return ReturnStablecoinEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ReturnStablecoinEvent): Uint8Array { + return ReturnStablecoinEvent.encode(message).finish(); + }, + toProtoMsg(message: ReturnStablecoinEvent): ReturnStablecoinEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.ReturnStablecoinEvent", + value: ReturnStablecoinEvent.encode(message).finish() + }; + } +}; +function createBaseLiquidateCollateralEvent(): LiquidateCollateralEvent { + return { + liquidator: "", + debtor: "", + collateralDenom: "", + collateralAmountLiquidated: "", + collateralAmountLiquidator: "", + collateralAmountFee: "", + liquidationPrice: "", + marketPrice: "", + discount: "", + debtDenom: "", + debtAmount: "", + id: BigInt(0), + principalAmount: "", + interestDenom: "", + interestAmount: "" + }; +} +export const LiquidateCollateralEvent = { + typeUrl: "/Switcheo.carbon.cdp.LiquidateCollateralEvent", + encode(message: LiquidateCollateralEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidator !== "") { + writer.uint32(10).string(message.liquidator); + } + if (message.debtor !== "") { + writer.uint32(18).string(message.debtor); + } + if (message.collateralDenom !== "") { + writer.uint32(26).string(message.collateralDenom); + } + if (message.collateralAmountLiquidated !== "") { + writer.uint32(34).string(message.collateralAmountLiquidated); + } + if (message.collateralAmountLiquidator !== "") { + writer.uint32(42).string(message.collateralAmountLiquidator); + } + if (message.collateralAmountFee !== "") { + writer.uint32(50).string(message.collateralAmountFee); + } + if (message.liquidationPrice !== "") { + writer.uint32(58).string(Decimal.fromUserInput(message.liquidationPrice, 18).atomics); + } + if (message.marketPrice !== "") { + writer.uint32(66).string(Decimal.fromUserInput(message.marketPrice, 18).atomics); + } + if (message.discount !== "") { + writer.uint32(74).string(Decimal.fromUserInput(message.discount, 18).atomics); + } + if (message.debtDenom !== "") { + writer.uint32(82).string(message.debtDenom); + } + if (message.debtAmount !== "") { + writer.uint32(90).string(message.debtAmount); + } + if (message.id !== BigInt(0)) { + writer.uint32(96).uint64(message.id); + } + if (message.principalAmount !== "") { + writer.uint32(106).string(message.principalAmount); + } + if (message.interestDenom !== "") { + writer.uint32(114).string(message.interestDenom); + } + if (message.interestAmount !== "") { + writer.uint32(122).string(message.interestAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): LiquidateCollateralEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidateCollateralEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidator = reader.string(); + break; + case 2: + message.debtor = reader.string(); + break; + case 3: + message.collateralDenom = reader.string(); + break; + case 4: + message.collateralAmountLiquidated = reader.string(); + break; + case 5: + message.collateralAmountLiquidator = reader.string(); + break; + case 6: + message.collateralAmountFee = reader.string(); + break; + case 7: + message.liquidationPrice = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 8: + message.marketPrice = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 9: + message.discount = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 10: + message.debtDenom = reader.string(); + break; + case 11: + message.debtAmount = reader.string(); + break; + case 12: + message.id = reader.uint64(); + break; + case 13: + message.principalAmount = reader.string(); + break; + case 14: + message.interestDenom = reader.string(); + break; + case 15: + message.interestAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidateCollateralEvent { + const message = createBaseLiquidateCollateralEvent(); + message.liquidator = object.liquidator ?? ""; + message.debtor = object.debtor ?? ""; + message.collateralDenom = object.collateralDenom ?? ""; + message.collateralAmountLiquidated = object.collateralAmountLiquidated ?? ""; + message.collateralAmountLiquidator = object.collateralAmountLiquidator ?? ""; + message.collateralAmountFee = object.collateralAmountFee ?? ""; + message.liquidationPrice = object.liquidationPrice ?? ""; + message.marketPrice = object.marketPrice ?? ""; + message.discount = object.discount ?? ""; + message.debtDenom = object.debtDenom ?? ""; + message.debtAmount = object.debtAmount ?? ""; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.principalAmount = object.principalAmount ?? ""; + message.interestDenom = object.interestDenom ?? ""; + message.interestAmount = object.interestAmount ?? ""; + return message; + }, + fromAmino(object: LiquidateCollateralEventAmino): LiquidateCollateralEvent { + const message = createBaseLiquidateCollateralEvent(); + if (object.liquidator !== undefined && object.liquidator !== null) { + message.liquidator = object.liquidator; + } + if (object.debtor !== undefined && object.debtor !== null) { + message.debtor = object.debtor; + } + if (object.collateral_denom !== undefined && object.collateral_denom !== null) { + message.collateralDenom = object.collateral_denom; + } + if (object.collateral_amount_liquidated !== undefined && object.collateral_amount_liquidated !== null) { + message.collateralAmountLiquidated = object.collateral_amount_liquidated; + } + if (object.collateral_amount_liquidator !== undefined && object.collateral_amount_liquidator !== null) { + message.collateralAmountLiquidator = object.collateral_amount_liquidator; + } + if (object.collateral_amount_fee !== undefined && object.collateral_amount_fee !== null) { + message.collateralAmountFee = object.collateral_amount_fee; + } + if (object.liquidation_price !== undefined && object.liquidation_price !== null) { + message.liquidationPrice = object.liquidation_price; + } + if (object.market_price !== undefined && object.market_price !== null) { + message.marketPrice = object.market_price; + } + if (object.discount !== undefined && object.discount !== null) { + message.discount = object.discount; + } + if (object.debt_denom !== undefined && object.debt_denom !== null) { + message.debtDenom = object.debt_denom; + } + if (object.debt_amount !== undefined && object.debt_amount !== null) { + message.debtAmount = object.debt_amount; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.principal_amount !== undefined && object.principal_amount !== null) { + message.principalAmount = object.principal_amount; + } + if (object.interest_denom !== undefined && object.interest_denom !== null) { + message.interestDenom = object.interest_denom; + } + if (object.interest_amount !== undefined && object.interest_amount !== null) { + message.interestAmount = object.interest_amount; + } + return message; + }, + toAmino(message: LiquidateCollateralEvent, useInterfaces: boolean = false): LiquidateCollateralEventAmino { + const obj: any = {}; + obj.liquidator = message.liquidator === "" ? undefined : message.liquidator; + obj.debtor = message.debtor === "" ? undefined : message.debtor; + obj.collateral_denom = message.collateralDenom === "" ? undefined : message.collateralDenom; + obj.collateral_amount_liquidated = message.collateralAmountLiquidated === "" ? undefined : message.collateralAmountLiquidated; + obj.collateral_amount_liquidator = message.collateralAmountLiquidator === "" ? undefined : message.collateralAmountLiquidator; + obj.collateral_amount_fee = message.collateralAmountFee === "" ? undefined : message.collateralAmountFee; + obj.liquidation_price = message.liquidationPrice === "" ? undefined : message.liquidationPrice; + obj.market_price = message.marketPrice === "" ? undefined : message.marketPrice; + obj.discount = message.discount === "" ? undefined : message.discount; + obj.debt_denom = message.debtDenom === "" ? undefined : message.debtDenom; + obj.debt_amount = message.debtAmount === "" ? undefined : message.debtAmount; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.principal_amount = message.principalAmount === "" ? undefined : message.principalAmount; + obj.interest_denom = message.interestDenom === "" ? undefined : message.interestDenom; + obj.interest_amount = message.interestAmount === "" ? undefined : message.interestAmount; + return obj; + }, + fromAminoMsg(object: LiquidateCollateralEventAminoMsg): LiquidateCollateralEvent { + return LiquidateCollateralEvent.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidateCollateralEventProtoMsg, useInterfaces: boolean = false): LiquidateCollateralEvent { + return LiquidateCollateralEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: LiquidateCollateralEvent): Uint8Array { + return LiquidateCollateralEvent.encode(message).finish(); + }, + toProtoMsg(message: LiquidateCollateralEvent): LiquidateCollateralEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.LiquidateCollateralEvent", + value: LiquidateCollateralEvent.encode(message).finish() + }; + } +}; +function createBaseClaimRewardEvent(): ClaimRewardEvent { + return { + receiver: "", + rewardSchemeId: "", + rewardClaimed: "" + }; +} +export const ClaimRewardEvent = { + typeUrl: "/Switcheo.carbon.cdp.ClaimRewardEvent", + encode(message: ClaimRewardEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.receiver !== "") { + writer.uint32(10).string(message.receiver); + } + if (message.rewardSchemeId !== "") { + writer.uint32(18).string(message.rewardSchemeId); + } + if (message.rewardClaimed !== "") { + writer.uint32(26).string(message.rewardClaimed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ClaimRewardEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClaimRewardEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.receiver = reader.string(); + break; + case 2: + message.rewardSchemeId = reader.string(); + break; + case 3: + message.rewardClaimed = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClaimRewardEvent { + const message = createBaseClaimRewardEvent(); + message.receiver = object.receiver ?? ""; + message.rewardSchemeId = object.rewardSchemeId ?? ""; + message.rewardClaimed = object.rewardClaimed ?? ""; + return message; + }, + fromAmino(object: ClaimRewardEventAmino): ClaimRewardEvent { + const message = createBaseClaimRewardEvent(); + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.reward_scheme_id !== undefined && object.reward_scheme_id !== null) { + message.rewardSchemeId = object.reward_scheme_id; + } + if (object.reward_claimed !== undefined && object.reward_claimed !== null) { + message.rewardClaimed = object.reward_claimed; + } + return message; + }, + toAmino(message: ClaimRewardEvent, useInterfaces: boolean = false): ClaimRewardEventAmino { + const obj: any = {}; + obj.receiver = message.receiver === "" ? undefined : message.receiver; + obj.reward_scheme_id = message.rewardSchemeId === "" ? undefined : message.rewardSchemeId; + obj.reward_claimed = message.rewardClaimed === "" ? undefined : message.rewardClaimed; + return obj; + }, + fromAminoMsg(object: ClaimRewardEventAminoMsg): ClaimRewardEvent { + return ClaimRewardEvent.fromAmino(object.value); + }, + fromProtoMsg(message: ClaimRewardEventProtoMsg, useInterfaces: boolean = false): ClaimRewardEvent { + return ClaimRewardEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ClaimRewardEvent): Uint8Array { + return ClaimRewardEvent.encode(message).finish(); + }, + toProtoMsg(message: ClaimRewardEvent): ClaimRewardEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.ClaimRewardEvent", + value: ClaimRewardEvent.encode(message).finish() + }; + } +}; +function createBaseRewardDebtEvent(): RewardDebtEvent { + return { + rewardDebt: undefined, + type: "" + }; +} +export const RewardDebtEvent = { + typeUrl: "/Switcheo.carbon.cdp.RewardDebtEvent", + encode(message: RewardDebtEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rewardDebt !== undefined) { + RewardDebt.encode(message.rewardDebt, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RewardDebtEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewardDebtEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardDebt = RewardDebt.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RewardDebtEvent { + const message = createBaseRewardDebtEvent(); + message.rewardDebt = object.rewardDebt !== undefined && object.rewardDebt !== null ? RewardDebt.fromPartial(object.rewardDebt) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: RewardDebtEventAmino): RewardDebtEvent { + const message = createBaseRewardDebtEvent(); + if (object.reward_debt !== undefined && object.reward_debt !== null) { + message.rewardDebt = RewardDebt.fromAmino(object.reward_debt); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: RewardDebtEvent, useInterfaces: boolean = false): RewardDebtEventAmino { + const obj: any = {}; + obj.reward_debt = message.rewardDebt ? RewardDebt.toAmino(message.rewardDebt, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: RewardDebtEventAminoMsg): RewardDebtEvent { + return RewardDebtEvent.fromAmino(object.value); + }, + fromProtoMsg(message: RewardDebtEventProtoMsg, useInterfaces: boolean = false): RewardDebtEvent { + return RewardDebtEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RewardDebtEvent): Uint8Array { + return RewardDebtEvent.encode(message).finish(); + }, + toProtoMsg(message: RewardDebtEvent): RewardDebtEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.RewardDebtEvent", + value: RewardDebtEvent.encode(message).finish() + }; + } +}; +function createBaseRewardSchemeEvent(): RewardSchemeEvent { + return { + rewardScheme: undefined, + type: "" + }; +} +export const RewardSchemeEvent = { + typeUrl: "/Switcheo.carbon.cdp.RewardSchemeEvent", + encode(message: RewardSchemeEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rewardScheme !== undefined) { + RewardScheme.encode(message.rewardScheme, writer.uint32(10).fork()).ldelim(); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RewardSchemeEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewardSchemeEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardScheme = RewardScheme.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RewardSchemeEvent { + const message = createBaseRewardSchemeEvent(); + message.rewardScheme = object.rewardScheme !== undefined && object.rewardScheme !== null ? RewardScheme.fromPartial(object.rewardScheme) : undefined; + message.type = object.type ?? ""; + return message; + }, + fromAmino(object: RewardSchemeEventAmino): RewardSchemeEvent { + const message = createBaseRewardSchemeEvent(); + if (object.reward_scheme !== undefined && object.reward_scheme !== null) { + message.rewardScheme = RewardScheme.fromAmino(object.reward_scheme); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + return message; + }, + toAmino(message: RewardSchemeEvent, useInterfaces: boolean = false): RewardSchemeEventAmino { + const obj: any = {}; + obj.reward_scheme = message.rewardScheme ? RewardScheme.toAmino(message.rewardScheme, useInterfaces) : undefined; + obj.type = message.type === "" ? undefined : message.type; + return obj; + }, + fromAminoMsg(object: RewardSchemeEventAminoMsg): RewardSchemeEvent { + return RewardSchemeEvent.fromAmino(object.value); + }, + fromProtoMsg(message: RewardSchemeEventProtoMsg, useInterfaces: boolean = false): RewardSchemeEvent { + return RewardSchemeEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RewardSchemeEvent): Uint8Array { + return RewardSchemeEvent.encode(message).finish(); + }, + toProtoMsg(message: RewardSchemeEvent): RewardSchemeEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.RewardSchemeEvent", + value: RewardSchemeEvent.encode(message).finish() + }; + } +}; +function createBaseAddReserveEvent(): AddReserveEvent { + return { + rewardScheme: undefined, + amountAdded: "" + }; +} +export const AddReserveEvent = { + typeUrl: "/Switcheo.carbon.cdp.AddReserveEvent", + encode(message: AddReserveEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rewardScheme !== undefined) { + RewardScheme.encode(message.rewardScheme, writer.uint32(10).fork()).ldelim(); + } + if (message.amountAdded !== "") { + writer.uint32(18).string(message.amountAdded); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AddReserveEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddReserveEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardScheme = RewardScheme.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.amountAdded = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddReserveEvent { + const message = createBaseAddReserveEvent(); + message.rewardScheme = object.rewardScheme !== undefined && object.rewardScheme !== null ? RewardScheme.fromPartial(object.rewardScheme) : undefined; + message.amountAdded = object.amountAdded ?? ""; + return message; + }, + fromAmino(object: AddReserveEventAmino): AddReserveEvent { + const message = createBaseAddReserveEvent(); + if (object.reward_scheme !== undefined && object.reward_scheme !== null) { + message.rewardScheme = RewardScheme.fromAmino(object.reward_scheme); + } + if (object.amount_added !== undefined && object.amount_added !== null) { + message.amountAdded = object.amount_added; + } + return message; + }, + toAmino(message: AddReserveEvent, useInterfaces: boolean = false): AddReserveEventAmino { + const obj: any = {}; + obj.reward_scheme = message.rewardScheme ? RewardScheme.toAmino(message.rewardScheme, useInterfaces) : undefined; + obj.amount_added = message.amountAdded === "" ? undefined : message.amountAdded; + return obj; + }, + fromAminoMsg(object: AddReserveEventAminoMsg): AddReserveEvent { + return AddReserveEvent.fromAmino(object.value); + }, + fromProtoMsg(message: AddReserveEventProtoMsg, useInterfaces: boolean = false): AddReserveEvent { + return AddReserveEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AddReserveEvent): Uint8Array { + return AddReserveEvent.encode(message).finish(); + }, + toProtoMsg(message: AddReserveEvent): AddReserveEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.AddReserveEvent", + value: AddReserveEvent.encode(message).finish() + }; + } +}; +function createBaseRefundReserveEvent(): RefundReserveEvent { + return { + rewardScheme: undefined, + amountRefunded: "" + }; +} +export const RefundReserveEvent = { + typeUrl: "/Switcheo.carbon.cdp.RefundReserveEvent", + encode(message: RefundReserveEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rewardScheme !== undefined) { + RewardScheme.encode(message.rewardScheme, writer.uint32(10).fork()).ldelim(); + } + if (message.amountRefunded !== "") { + writer.uint32(18).string(message.amountRefunded); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RefundReserveEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRefundReserveEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardScheme = RewardScheme.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.amountRefunded = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RefundReserveEvent { + const message = createBaseRefundReserveEvent(); + message.rewardScheme = object.rewardScheme !== undefined && object.rewardScheme !== null ? RewardScheme.fromPartial(object.rewardScheme) : undefined; + message.amountRefunded = object.amountRefunded ?? ""; + return message; + }, + fromAmino(object: RefundReserveEventAmino): RefundReserveEvent { + const message = createBaseRefundReserveEvent(); + if (object.reward_scheme !== undefined && object.reward_scheme !== null) { + message.rewardScheme = RewardScheme.fromAmino(object.reward_scheme); + } + if (object.amount_refunded !== undefined && object.amount_refunded !== null) { + message.amountRefunded = object.amount_refunded; + } + return message; + }, + toAmino(message: RefundReserveEvent, useInterfaces: boolean = false): RefundReserveEventAmino { + const obj: any = {}; + obj.reward_scheme = message.rewardScheme ? RewardScheme.toAmino(message.rewardScheme, useInterfaces) : undefined; + obj.amount_refunded = message.amountRefunded === "" ? undefined : message.amountRefunded; + return obj; + }, + fromAminoMsg(object: RefundReserveEventAminoMsg): RefundReserveEvent { + return RefundReserveEvent.fromAmino(object.value); + }, + fromProtoMsg(message: RefundReserveEventProtoMsg, useInterfaces: boolean = false): RefundReserveEvent { + return RefundReserveEvent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RefundReserveEvent): Uint8Array { + return RefundReserveEvent.encode(message).finish(); + }, + toProtoMsg(message: RefundReserveEvent): RefundReserveEventProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.RefundReserveEvent", + value: RefundReserveEvent.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/genesis.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/genesis.ts new file mode 100644 index 000000000..b43eced3a --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/genesis.ts @@ -0,0 +1,1148 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { RateStrategyParams, RateStrategyParamsAmino, RateStrategyParamsSDKType } from "./rate_strategy_params"; +import { AssetParams, AssetParamsAmino, AssetParamsSDKType } from "./asset_params"; +import { DebtInfo, DebtInfoAmino, DebtInfoSDKType } from "./debt_info"; +import { RewardScheme, RewardSchemeAmino, RewardSchemeSDKType } from "./reward_scheme"; +import { StablecoinDebtInfo, StablecoinDebtInfoAmino, StablecoinDebtInfoSDKType } from "./stablecoin_debt_info"; +import { StablecoinInterestInfo, StablecoinInterestInfoAmino, StablecoinInterestInfoSDKType } from "./stablecoin_interest_info"; +import { EModeCategory, EModeCategoryAmino, EModeCategorySDKType } from "./e_mode_category"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +export interface GenesisState_CollateralizedCibtRecordsEntry { + key: string; + value: Uint8Array; +} +export interface GenesisState_CollateralizedCibtRecordsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface GenesisState_CollateralizedCibtRecordsEntryAmino { + key?: string; + value?: string; +} +export interface GenesisState_CollateralizedCibtRecordsEntryAminoMsg { + type: string; + value: GenesisState_CollateralizedCibtRecordsEntryAmino; +} +export interface GenesisState_CollateralizedCibtRecordsEntrySDKType { + key: string; + value: Uint8Array; +} +export interface GenesisState_PrincipalRecordsEntry { + key: string; + value: Uint8Array; +} +export interface GenesisState_PrincipalRecordsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface GenesisState_PrincipalRecordsEntryAmino { + key?: string; + value?: string; +} +export interface GenesisState_PrincipalRecordsEntryAminoMsg { + type: string; + value: GenesisState_PrincipalRecordsEntryAmino; +} +export interface GenesisState_PrincipalRecordsEntrySDKType { + key: string; + value: Uint8Array; +} +export interface GenesisState_InitialCumulativeInterestMultiplierRecordsEntry { + key: string; + value: Uint8Array; +} +export interface GenesisState_InitialCumulativeInterestMultiplierRecordsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface GenesisState_InitialCumulativeInterestMultiplierRecordsEntryAmino { + key?: string; + value?: string; +} +export interface GenesisState_InitialCumulativeInterestMultiplierRecordsEntryAminoMsg { + type: string; + value: GenesisState_InitialCumulativeInterestMultiplierRecordsEntryAmino; +} +export interface GenesisState_InitialCumulativeInterestMultiplierRecordsEntrySDKType { + key: string; + value: Uint8Array; +} +export interface GenesisState_PrincipalStablecoinDebtRecordsEntry { + key: string; + value: Uint8Array; +} +export interface GenesisState_PrincipalStablecoinDebtRecordsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface GenesisState_PrincipalStablecoinDebtRecordsEntryAmino { + key?: string; + value?: string; +} +export interface GenesisState_PrincipalStablecoinDebtRecordsEntryAminoMsg { + type: string; + value: GenesisState_PrincipalStablecoinDebtRecordsEntryAmino; +} +export interface GenesisState_PrincipalStablecoinDebtRecordsEntrySDKType { + key: string; + value: Uint8Array; +} +export interface GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry { + key: string; + value: Uint8Array; +} +export interface GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntryAmino { + key?: string; + value?: string; +} +export interface GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntryAminoMsg { + type: string; + value: GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntryAmino; +} +export interface GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntrySDKType { + key: string; + value: Uint8Array; +} +export interface GenesisState_RewardDebtRecordsEntry { + key: string; + value: Uint8Array; +} +export interface GenesisState_RewardDebtRecordsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface GenesisState_RewardDebtRecordsEntryAmino { + key?: string; + value?: string; +} +export interface GenesisState_RewardDebtRecordsEntryAminoMsg { + type: string; + value: GenesisState_RewardDebtRecordsEntryAmino; +} +export interface GenesisState_RewardDebtRecordsEntrySDKType { + key: string; + value: Uint8Array; +} +export interface GenesisState_AccountEModeCategoryRecordsEntry { + key: string; + value: string; +} +export interface GenesisState_AccountEModeCategoryRecordsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface GenesisState_AccountEModeCategoryRecordsEntryAmino { + key?: string; + value?: string; +} +export interface GenesisState_AccountEModeCategoryRecordsEntryAminoMsg { + type: string; + value: GenesisState_AccountEModeCategoryRecordsEntryAmino; +} +export interface GenesisState_AccountEModeCategoryRecordsEntrySDKType { + key: string; + value: string; +} +/** GenesisState defines the cdp module's genesis state. */ +export interface GenesisState { + params: Params | undefined; + rateStrategies: RateStrategyParams[]; + assets: AssetParams[]; + debtInfos: DebtInfo[]; + rewardSchemes: RewardScheme[]; + sequenceNumber: bigint; + collateralizedCibtRecords: { + [key: string]: Uint8Array; + }; + principalRecords: { + [key: string]: Uint8Array; + }; + initialCumulativeInterestMultiplierRecords: { + [key: string]: Uint8Array; + }; + stablecoinDebtInfo: StablecoinDebtInfo | undefined; + principalStablecoinDebtRecords: { + [key: string]: Uint8Array; + }; + stablecoinInitialCumulativeInterestMultiplierRecords: { + [key: string]: Uint8Array; + }; + rewardDebtRecords: { + [key: string]: Uint8Array; + }; + stablecoinInterestInfo: StablecoinInterestInfo | undefined; + eModeCategories: EModeCategory[]; + accountEModeCategoryRecords: { + [key: string]: string; + }; +} +export interface GenesisStateProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the cdp module's genesis state. */ +export interface GenesisStateAmino { + params?: ParamsAmino | undefined; + rate_strategies?: RateStrategyParamsAmino[]; + assets?: AssetParamsAmino[]; + debt_infos?: DebtInfoAmino[]; + reward_schemes?: RewardSchemeAmino[]; + sequence_number?: string; + collateralized_cibt_records?: { + [key: string]: string; + }; + principal_records?: { + [key: string]: string; + }; + initial_cumulative_interest_multiplier_records?: { + [key: string]: string; + }; + stablecoin_debt_info?: StablecoinDebtInfoAmino | undefined; + principal_stablecoin_debt_records?: { + [key: string]: string; + }; + stablecoin_initial_cumulative_interest_multiplier_records?: { + [key: string]: string; + }; + reward_debt_records?: { + [key: string]: string; + }; + stablecoin_interest_info?: StablecoinInterestInfoAmino | undefined; + e_mode_categories?: EModeCategoryAmino[]; + account_e_mode_category_records?: { + [key: string]: string; + }; +} +export interface GenesisStateAminoMsg { + type: "/Switcheo.carbon.cdp.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the cdp module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; + rate_strategies: RateStrategyParamsSDKType[]; + assets: AssetParamsSDKType[]; + debt_infos: DebtInfoSDKType[]; + reward_schemes: RewardSchemeSDKType[]; + sequence_number: bigint; + collateralized_cibt_records: { + [key: string]: Uint8Array; + }; + principal_records: { + [key: string]: Uint8Array; + }; + initial_cumulative_interest_multiplier_records: { + [key: string]: Uint8Array; + }; + stablecoin_debt_info: StablecoinDebtInfoSDKType | undefined; + principal_stablecoin_debt_records: { + [key: string]: Uint8Array; + }; + stablecoin_initial_cumulative_interest_multiplier_records: { + [key: string]: Uint8Array; + }; + reward_debt_records: { + [key: string]: Uint8Array; + }; + stablecoin_interest_info: StablecoinInterestInfoSDKType | undefined; + e_mode_categories: EModeCategorySDKType[]; + account_e_mode_category_records: { + [key: string]: string; + }; +} +function createBaseGenesisState_CollateralizedCibtRecordsEntry(): GenesisState_CollateralizedCibtRecordsEntry { + return { + key: "", + value: new Uint8Array() + }; +} +export const GenesisState_CollateralizedCibtRecordsEntry = { + encode(message: GenesisState_CollateralizedCibtRecordsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState_CollateralizedCibtRecordsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState_CollateralizedCibtRecordsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState_CollateralizedCibtRecordsEntry { + const message = createBaseGenesisState_CollateralizedCibtRecordsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: GenesisState_CollateralizedCibtRecordsEntryAmino): GenesisState_CollateralizedCibtRecordsEntry { + const message = createBaseGenesisState_CollateralizedCibtRecordsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: GenesisState_CollateralizedCibtRecordsEntry, useInterfaces: boolean = false): GenesisState_CollateralizedCibtRecordsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisState_CollateralizedCibtRecordsEntryAminoMsg): GenesisState_CollateralizedCibtRecordsEntry { + return GenesisState_CollateralizedCibtRecordsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisState_CollateralizedCibtRecordsEntryProtoMsg, useInterfaces: boolean = false): GenesisState_CollateralizedCibtRecordsEntry { + return GenesisState_CollateralizedCibtRecordsEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState_CollateralizedCibtRecordsEntry): Uint8Array { + return GenesisState_CollateralizedCibtRecordsEntry.encode(message).finish(); + } +}; +function createBaseGenesisState_PrincipalRecordsEntry(): GenesisState_PrincipalRecordsEntry { + return { + key: "", + value: new Uint8Array() + }; +} +export const GenesisState_PrincipalRecordsEntry = { + encode(message: GenesisState_PrincipalRecordsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState_PrincipalRecordsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState_PrincipalRecordsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState_PrincipalRecordsEntry { + const message = createBaseGenesisState_PrincipalRecordsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: GenesisState_PrincipalRecordsEntryAmino): GenesisState_PrincipalRecordsEntry { + const message = createBaseGenesisState_PrincipalRecordsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: GenesisState_PrincipalRecordsEntry, useInterfaces: boolean = false): GenesisState_PrincipalRecordsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisState_PrincipalRecordsEntryAminoMsg): GenesisState_PrincipalRecordsEntry { + return GenesisState_PrincipalRecordsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisState_PrincipalRecordsEntryProtoMsg, useInterfaces: boolean = false): GenesisState_PrincipalRecordsEntry { + return GenesisState_PrincipalRecordsEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState_PrincipalRecordsEntry): Uint8Array { + return GenesisState_PrincipalRecordsEntry.encode(message).finish(); + } +}; +function createBaseGenesisState_InitialCumulativeInterestMultiplierRecordsEntry(): GenesisState_InitialCumulativeInterestMultiplierRecordsEntry { + return { + key: "", + value: new Uint8Array() + }; +} +export const GenesisState_InitialCumulativeInterestMultiplierRecordsEntry = { + encode(message: GenesisState_InitialCumulativeInterestMultiplierRecordsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState_InitialCumulativeInterestMultiplierRecordsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState_InitialCumulativeInterestMultiplierRecordsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState_InitialCumulativeInterestMultiplierRecordsEntry { + const message = createBaseGenesisState_InitialCumulativeInterestMultiplierRecordsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: GenesisState_InitialCumulativeInterestMultiplierRecordsEntryAmino): GenesisState_InitialCumulativeInterestMultiplierRecordsEntry { + const message = createBaseGenesisState_InitialCumulativeInterestMultiplierRecordsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: GenesisState_InitialCumulativeInterestMultiplierRecordsEntry, useInterfaces: boolean = false): GenesisState_InitialCumulativeInterestMultiplierRecordsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisState_InitialCumulativeInterestMultiplierRecordsEntryAminoMsg): GenesisState_InitialCumulativeInterestMultiplierRecordsEntry { + return GenesisState_InitialCumulativeInterestMultiplierRecordsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisState_InitialCumulativeInterestMultiplierRecordsEntryProtoMsg, useInterfaces: boolean = false): GenesisState_InitialCumulativeInterestMultiplierRecordsEntry { + return GenesisState_InitialCumulativeInterestMultiplierRecordsEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState_InitialCumulativeInterestMultiplierRecordsEntry): Uint8Array { + return GenesisState_InitialCumulativeInterestMultiplierRecordsEntry.encode(message).finish(); + } +}; +function createBaseGenesisState_PrincipalStablecoinDebtRecordsEntry(): GenesisState_PrincipalStablecoinDebtRecordsEntry { + return { + key: "", + value: new Uint8Array() + }; +} +export const GenesisState_PrincipalStablecoinDebtRecordsEntry = { + encode(message: GenesisState_PrincipalStablecoinDebtRecordsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState_PrincipalStablecoinDebtRecordsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState_PrincipalStablecoinDebtRecordsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState_PrincipalStablecoinDebtRecordsEntry { + const message = createBaseGenesisState_PrincipalStablecoinDebtRecordsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: GenesisState_PrincipalStablecoinDebtRecordsEntryAmino): GenesisState_PrincipalStablecoinDebtRecordsEntry { + const message = createBaseGenesisState_PrincipalStablecoinDebtRecordsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: GenesisState_PrincipalStablecoinDebtRecordsEntry, useInterfaces: boolean = false): GenesisState_PrincipalStablecoinDebtRecordsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisState_PrincipalStablecoinDebtRecordsEntryAminoMsg): GenesisState_PrincipalStablecoinDebtRecordsEntry { + return GenesisState_PrincipalStablecoinDebtRecordsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisState_PrincipalStablecoinDebtRecordsEntryProtoMsg, useInterfaces: boolean = false): GenesisState_PrincipalStablecoinDebtRecordsEntry { + return GenesisState_PrincipalStablecoinDebtRecordsEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState_PrincipalStablecoinDebtRecordsEntry): Uint8Array { + return GenesisState_PrincipalStablecoinDebtRecordsEntry.encode(message).finish(); + } +}; +function createBaseGenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry(): GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry { + return { + key: "", + value: new Uint8Array() + }; +} +export const GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry = { + encode(message: GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry { + const message = createBaseGenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntryAmino): GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry { + const message = createBaseGenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry, useInterfaces: boolean = false): GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntryAminoMsg): GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry { + return GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntryProtoMsg, useInterfaces: boolean = false): GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry { + return GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry): Uint8Array { + return GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry.encode(message).finish(); + } +}; +function createBaseGenesisState_RewardDebtRecordsEntry(): GenesisState_RewardDebtRecordsEntry { + return { + key: "", + value: new Uint8Array() + }; +} +export const GenesisState_RewardDebtRecordsEntry = { + encode(message: GenesisState_RewardDebtRecordsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState_RewardDebtRecordsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState_RewardDebtRecordsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState_RewardDebtRecordsEntry { + const message = createBaseGenesisState_RewardDebtRecordsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: GenesisState_RewardDebtRecordsEntryAmino): GenesisState_RewardDebtRecordsEntry { + const message = createBaseGenesisState_RewardDebtRecordsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: GenesisState_RewardDebtRecordsEntry, useInterfaces: boolean = false): GenesisState_RewardDebtRecordsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisState_RewardDebtRecordsEntryAminoMsg): GenesisState_RewardDebtRecordsEntry { + return GenesisState_RewardDebtRecordsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisState_RewardDebtRecordsEntryProtoMsg, useInterfaces: boolean = false): GenesisState_RewardDebtRecordsEntry { + return GenesisState_RewardDebtRecordsEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState_RewardDebtRecordsEntry): Uint8Array { + return GenesisState_RewardDebtRecordsEntry.encode(message).finish(); + } +}; +function createBaseGenesisState_AccountEModeCategoryRecordsEntry(): GenesisState_AccountEModeCategoryRecordsEntry { + return { + key: "", + value: "" + }; +} +export const GenesisState_AccountEModeCategoryRecordsEntry = { + encode(message: GenesisState_AccountEModeCategoryRecordsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState_AccountEModeCategoryRecordsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState_AccountEModeCategoryRecordsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState_AccountEModeCategoryRecordsEntry { + const message = createBaseGenesisState_AccountEModeCategoryRecordsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: GenesisState_AccountEModeCategoryRecordsEntryAmino): GenesisState_AccountEModeCategoryRecordsEntry { + const message = createBaseGenesisState_AccountEModeCategoryRecordsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: GenesisState_AccountEModeCategoryRecordsEntry, useInterfaces: boolean = false): GenesisState_AccountEModeCategoryRecordsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: GenesisState_AccountEModeCategoryRecordsEntryAminoMsg): GenesisState_AccountEModeCategoryRecordsEntry { + return GenesisState_AccountEModeCategoryRecordsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisState_AccountEModeCategoryRecordsEntryProtoMsg, useInterfaces: boolean = false): GenesisState_AccountEModeCategoryRecordsEntry { + return GenesisState_AccountEModeCategoryRecordsEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState_AccountEModeCategoryRecordsEntry): Uint8Array { + return GenesisState_AccountEModeCategoryRecordsEntry.encode(message).finish(); + } +}; +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + rateStrategies: [], + assets: [], + debtInfos: [], + rewardSchemes: [], + sequenceNumber: BigInt(0), + collateralizedCibtRecords: {}, + principalRecords: {}, + initialCumulativeInterestMultiplierRecords: {}, + stablecoinDebtInfo: StablecoinDebtInfo.fromPartial({}), + principalStablecoinDebtRecords: {}, + stablecoinInitialCumulativeInterestMultiplierRecords: {}, + rewardDebtRecords: {}, + stablecoinInterestInfo: StablecoinInterestInfo.fromPartial({}), + eModeCategories: [], + accountEModeCategoryRecords: {} + }; +} +export const GenesisState = { + typeUrl: "/Switcheo.carbon.cdp.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.rateStrategies) { + RateStrategyParams.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.assets) { + AssetParams.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.debtInfos) { + DebtInfo.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.rewardSchemes) { + RewardScheme.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.sequenceNumber !== BigInt(0)) { + writer.uint32(48).uint64(message.sequenceNumber); + } + Object.entries(message.collateralizedCibtRecords).forEach(([key, value]) => { + GenesisState_CollateralizedCibtRecordsEntry.encode({ + key: (key as any), + value + }, writer.uint32(58).fork()).ldelim(); + }); + Object.entries(message.principalRecords).forEach(([key, value]) => { + GenesisState_PrincipalRecordsEntry.encode({ + key: (key as any), + value + }, writer.uint32(66).fork()).ldelim(); + }); + Object.entries(message.initialCumulativeInterestMultiplierRecords).forEach(([key, value]) => { + GenesisState_InitialCumulativeInterestMultiplierRecordsEntry.encode({ + key: (key as any), + value + }, writer.uint32(74).fork()).ldelim(); + }); + if (message.stablecoinDebtInfo !== undefined) { + StablecoinDebtInfo.encode(message.stablecoinDebtInfo, writer.uint32(82).fork()).ldelim(); + } + Object.entries(message.principalStablecoinDebtRecords).forEach(([key, value]) => { + GenesisState_PrincipalStablecoinDebtRecordsEntry.encode({ + key: (key as any), + value + }, writer.uint32(90).fork()).ldelim(); + }); + Object.entries(message.stablecoinInitialCumulativeInterestMultiplierRecords).forEach(([key, value]) => { + GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry.encode({ + key: (key as any), + value + }, writer.uint32(98).fork()).ldelim(); + }); + Object.entries(message.rewardDebtRecords).forEach(([key, value]) => { + GenesisState_RewardDebtRecordsEntry.encode({ + key: (key as any), + value + }, writer.uint32(106).fork()).ldelim(); + }); + if (message.stablecoinInterestInfo !== undefined) { + StablecoinInterestInfo.encode(message.stablecoinInterestInfo, writer.uint32(114).fork()).ldelim(); + } + for (const v of message.eModeCategories) { + EModeCategory.encode(v!, writer.uint32(122).fork()).ldelim(); + } + Object.entries(message.accountEModeCategoryRecords).forEach(([key, value]) => { + GenesisState_AccountEModeCategoryRecordsEntry.encode({ + key: (key as any), + value + }, writer.uint32(130).fork()).ldelim(); + }); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.rateStrategies.push(RateStrategyParams.decode(reader, reader.uint32(), useInterfaces)); + break; + case 3: + message.assets.push(AssetParams.decode(reader, reader.uint32(), useInterfaces)); + break; + case 4: + message.debtInfos.push(DebtInfo.decode(reader, reader.uint32(), useInterfaces)); + break; + case 5: + message.rewardSchemes.push(RewardScheme.decode(reader, reader.uint32(), useInterfaces)); + break; + case 6: + message.sequenceNumber = reader.uint64(); + break; + case 7: + const entry7 = GenesisState_CollateralizedCibtRecordsEntry.decode(reader, reader.uint32()); + if (entry7.value !== undefined) { + message.collateralizedCibtRecords[entry7.key] = entry7.value; + } + break; + case 8: + const entry8 = GenesisState_PrincipalRecordsEntry.decode(reader, reader.uint32()); + if (entry8.value !== undefined) { + message.principalRecords[entry8.key] = entry8.value; + } + break; + case 9: + const entry9 = GenesisState_InitialCumulativeInterestMultiplierRecordsEntry.decode(reader, reader.uint32()); + if (entry9.value !== undefined) { + message.initialCumulativeInterestMultiplierRecords[entry9.key] = entry9.value; + } + break; + case 10: + message.stablecoinDebtInfo = StablecoinDebtInfo.decode(reader, reader.uint32(), useInterfaces); + break; + case 11: + const entry11 = GenesisState_PrincipalStablecoinDebtRecordsEntry.decode(reader, reader.uint32()); + if (entry11.value !== undefined) { + message.principalStablecoinDebtRecords[entry11.key] = entry11.value; + } + break; + case 12: + const entry12 = GenesisState_StablecoinInitialCumulativeInterestMultiplierRecordsEntry.decode(reader, reader.uint32()); + if (entry12.value !== undefined) { + message.stablecoinInitialCumulativeInterestMultiplierRecords[entry12.key] = entry12.value; + } + break; + case 13: + const entry13 = GenesisState_RewardDebtRecordsEntry.decode(reader, reader.uint32()); + if (entry13.value !== undefined) { + message.rewardDebtRecords[entry13.key] = entry13.value; + } + break; + case 14: + message.stablecoinInterestInfo = StablecoinInterestInfo.decode(reader, reader.uint32(), useInterfaces); + break; + case 15: + message.eModeCategories.push(EModeCategory.decode(reader, reader.uint32(), useInterfaces)); + break; + case 16: + const entry16 = GenesisState_AccountEModeCategoryRecordsEntry.decode(reader, reader.uint32()); + if (entry16.value !== undefined) { + message.accountEModeCategoryRecords[entry16.key] = entry16.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.rateStrategies = object.rateStrategies?.map(e => RateStrategyParams.fromPartial(e)) || []; + message.assets = object.assets?.map(e => AssetParams.fromPartial(e)) || []; + message.debtInfos = object.debtInfos?.map(e => DebtInfo.fromPartial(e)) || []; + message.rewardSchemes = object.rewardSchemes?.map(e => RewardScheme.fromPartial(e)) || []; + message.sequenceNumber = object.sequenceNumber !== undefined && object.sequenceNumber !== null ? BigInt(object.sequenceNumber.toString()) : BigInt(0); + message.collateralizedCibtRecords = Object.entries(object.collateralizedCibtRecords ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromPartial(value); + } + return acc; + }, {}); + message.principalRecords = Object.entries(object.principalRecords ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromPartial(value); + } + return acc; + }, {}); + message.initialCumulativeInterestMultiplierRecords = Object.entries(object.initialCumulativeInterestMultiplierRecords ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromPartial(value); + } + return acc; + }, {}); + message.stablecoinDebtInfo = object.stablecoinDebtInfo !== undefined && object.stablecoinDebtInfo !== null ? StablecoinDebtInfo.fromPartial(object.stablecoinDebtInfo) : undefined; + message.principalStablecoinDebtRecords = Object.entries(object.principalStablecoinDebtRecords ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromPartial(value); + } + return acc; + }, {}); + message.stablecoinInitialCumulativeInterestMultiplierRecords = Object.entries(object.stablecoinInitialCumulativeInterestMultiplierRecords ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromPartial(value); + } + return acc; + }, {}); + message.rewardDebtRecords = Object.entries(object.rewardDebtRecords ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromPartial(value); + } + return acc; + }, {}); + message.stablecoinInterestInfo = object.stablecoinInterestInfo !== undefined && object.stablecoinInterestInfo !== null ? StablecoinInterestInfo.fromPartial(object.stablecoinInterestInfo) : undefined; + message.eModeCategories = object.eModeCategories?.map(e => EModeCategory.fromPartial(e)) || []; + message.accountEModeCategoryRecords = Object.entries(object.accountEModeCategoryRecords ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.rateStrategies = object.rate_strategies?.map(e => RateStrategyParams.fromAmino(e)) || []; + message.assets = object.assets?.map(e => AssetParams.fromAmino(e)) || []; + message.debtInfos = object.debt_infos?.map(e => DebtInfo.fromAmino(e)) || []; + message.rewardSchemes = object.reward_schemes?.map(e => RewardScheme.fromAmino(e)) || []; + if (object.sequence_number !== undefined && object.sequence_number !== null) { + message.sequenceNumber = BigInt(object.sequence_number); + } + message.collateralizedCibtRecords = Object.entries(object.collateralized_cibt_records ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromAmino(value); + } + return acc; + }, {}); + message.principalRecords = Object.entries(object.principal_records ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromAmino(value); + } + return acc; + }, {}); + message.initialCumulativeInterestMultiplierRecords = Object.entries(object.initial_cumulative_interest_multiplier_records ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromAmino(value); + } + return acc; + }, {}); + if (object.stablecoin_debt_info !== undefined && object.stablecoin_debt_info !== null) { + message.stablecoinDebtInfo = StablecoinDebtInfo.fromAmino(object.stablecoin_debt_info); + } + message.principalStablecoinDebtRecords = Object.entries(object.principal_stablecoin_debt_records ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromAmino(value); + } + return acc; + }, {}); + message.stablecoinInitialCumulativeInterestMultiplierRecords = Object.entries(object.stablecoin_initial_cumulative_interest_multiplier_records ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromAmino(value); + } + return acc; + }, {}); + message.rewardDebtRecords = Object.entries(object.reward_debt_records ?? {}).reduce<{ + [key: string]: bytes; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = bytes.fromAmino(value); + } + return acc; + }, {}); + if (object.stablecoin_interest_info !== undefined && object.stablecoin_interest_info !== null) { + message.stablecoinInterestInfo = StablecoinInterestInfo.fromAmino(object.stablecoin_interest_info); + } + message.eModeCategories = object.e_mode_categories?.map(e => EModeCategory.fromAmino(e)) || []; + message.accountEModeCategoryRecords = Object.entries(object.account_e_mode_category_records ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + if (message.rateStrategies) { + obj.rate_strategies = message.rateStrategies.map(e => e ? RateStrategyParams.toAmino(e, useInterfaces) : undefined); + } else { + obj.rate_strategies = message.rateStrategies; + } + if (message.assets) { + obj.assets = message.assets.map(e => e ? AssetParams.toAmino(e, useInterfaces) : undefined); + } else { + obj.assets = message.assets; + } + if (message.debtInfos) { + obj.debt_infos = message.debtInfos.map(e => e ? DebtInfo.toAmino(e, useInterfaces) : undefined); + } else { + obj.debt_infos = message.debtInfos; + } + if (message.rewardSchemes) { + obj.reward_schemes = message.rewardSchemes.map(e => e ? RewardScheme.toAmino(e, useInterfaces) : undefined); + } else { + obj.reward_schemes = message.rewardSchemes; + } + obj.sequence_number = message.sequenceNumber !== BigInt(0) ? message.sequenceNumber.toString() : undefined; + obj.collateralized_cibt_records = {}; + if (message.collateralizedCibtRecords) { + Object.entries(message.collateralizedCibtRecords).forEach(([k, v]) => { + obj.collateralized_cibt_records[k] = bytes.toAmino(v); + }); + } + obj.principal_records = {}; + if (message.principalRecords) { + Object.entries(message.principalRecords).forEach(([k, v]) => { + obj.principal_records[k] = bytes.toAmino(v); + }); + } + obj.initial_cumulative_interest_multiplier_records = {}; + if (message.initialCumulativeInterestMultiplierRecords) { + Object.entries(message.initialCumulativeInterestMultiplierRecords).forEach(([k, v]) => { + obj.initial_cumulative_interest_multiplier_records[k] = bytes.toAmino(v); + }); + } + obj.stablecoin_debt_info = message.stablecoinDebtInfo ? StablecoinDebtInfo.toAmino(message.stablecoinDebtInfo, useInterfaces) : undefined; + obj.principal_stablecoin_debt_records = {}; + if (message.principalStablecoinDebtRecords) { + Object.entries(message.principalStablecoinDebtRecords).forEach(([k, v]) => { + obj.principal_stablecoin_debt_records[k] = bytes.toAmino(v); + }); + } + obj.stablecoin_initial_cumulative_interest_multiplier_records = {}; + if (message.stablecoinInitialCumulativeInterestMultiplierRecords) { + Object.entries(message.stablecoinInitialCumulativeInterestMultiplierRecords).forEach(([k, v]) => { + obj.stablecoin_initial_cumulative_interest_multiplier_records[k] = bytes.toAmino(v); + }); + } + obj.reward_debt_records = {}; + if (message.rewardDebtRecords) { + Object.entries(message.rewardDebtRecords).forEach(([k, v]) => { + obj.reward_debt_records[k] = bytes.toAmino(v); + }); + } + obj.stablecoin_interest_info = message.stablecoinInterestInfo ? StablecoinInterestInfo.toAmino(message.stablecoinInterestInfo, useInterfaces) : undefined; + if (message.eModeCategories) { + obj.e_mode_categories = message.eModeCategories.map(e => e ? EModeCategory.toAmino(e, useInterfaces) : undefined); + } else { + obj.e_mode_categories = message.eModeCategories; + } + obj.account_e_mode_category_records = {}; + if (message.accountEModeCategoryRecords) { + Object.entries(message.accountEModeCategoryRecords).forEach(([k, v]) => { + obj.account_e_mode_category_records[k] = v; + }); + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/params.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/params.ts new file mode 100644 index 000000000..f297fa2d0 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/params.ts @@ -0,0 +1,538 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { BoolValue, BoolValueAmino, BoolValueSDKType } from "../../../google/protobuf/wrappers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** Params defines the parameters for the module. */ +export interface Params { + interestFee: string; + liquidationFee: string; + stablecoinMintCap: string; + /** + * Complete Liquidation Threshold determines how far between + * liquidation_threshold (LT) and collateral_value (CV) a borrower's + * borrowed value must have progressed in order to allow a full liquidation. + * 0.3 indicates 30% of the way from LT to CV. + * Valid values: 0-1. + */ + completeLiquidationThreshold: string; + /** + * Close Factor determines the portion of a borrower's position that can be + * liquidated in a single event. Minimum Close Factor is Close Factor at + * liquidation_threshold. 0.1 means that that 10% of the borrower position can + * be liquidated when the borrowed value passes the liquidation_threshold. + * close_factor scales linearly between minimum_close_factor and 1.0, + * reaching its maximum when borrowed value passes + * complete_liquidation_threshold. We can put it into the picture: + * + * borrowed C := collateral + * value value + * --- | ------- | ----- | -------- | -------> + * L CL + * + * liquidation = liquidation_threshold * C + * CL = L + (C-CL) * complete_liquidation_threshold + * is the borrowed value above which close factor will be 1. + * + * Valid values: 0-1. + */ + minimumCloseFactor: string; + /** + * Small Liquidation Size determines the USD value at which a borrow is + * considered small enough to be liquidated in a single transaction, bypassing + * dynamic close factor. + */ + smallLiquidationSize: string; + /** + * stale_price_grace_period determines the grace period before an oracle price + * is regarded as stale. This would cause certain actions like borrowing to be + * paused + */ + stalePriceGracePeriod: Duration | undefined; + /** + * cdp_paused if true, causes all supply, locking, lending, borrowing and + * liquidations to be paused + */ + cdpPaused: boolean; + /** + * time interval in between each adjustment of stablecoin interest rate to + * help stablecoin price stability + */ + stablecoinInterestRateEpoch: Duration | undefined; + /** + * used in formula to calculate stablecoin interest rate to help stablecoin + * price stability + */ + stablecoinInterestRateAdjusterCoefficient: string; +} +export interface ParamsProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino { + interest_fee?: string; + liquidation_fee?: string; + stablecoin_mint_cap?: string; + /** + * Complete Liquidation Threshold determines how far between + * liquidation_threshold (LT) and collateral_value (CV) a borrower's + * borrowed value must have progressed in order to allow a full liquidation. + * 0.3 indicates 30% of the way from LT to CV. + * Valid values: 0-1. + */ + complete_liquidation_threshold?: string; + /** + * Close Factor determines the portion of a borrower's position that can be + * liquidated in a single event. Minimum Close Factor is Close Factor at + * liquidation_threshold. 0.1 means that that 10% of the borrower position can + * be liquidated when the borrowed value passes the liquidation_threshold. + * close_factor scales linearly between minimum_close_factor and 1.0, + * reaching its maximum when borrowed value passes + * complete_liquidation_threshold. We can put it into the picture: + * + * borrowed C := collateral + * value value + * --- | ------- | ----- | -------- | -------> + * L CL + * + * liquidation = liquidation_threshold * C + * CL = L + (C-CL) * complete_liquidation_threshold + * is the borrowed value above which close factor will be 1. + * + * Valid values: 0-1. + */ + minimum_close_factor?: string; + /** + * Small Liquidation Size determines the USD value at which a borrow is + * considered small enough to be liquidated in a single transaction, bypassing + * dynamic close factor. + */ + small_liquidation_size?: string; + /** + * stale_price_grace_period determines the grace period before an oracle price + * is regarded as stale. This would cause certain actions like borrowing to be + * paused + */ + stale_price_grace_period?: DurationAmino | undefined; + /** + * cdp_paused if true, causes all supply, locking, lending, borrowing and + * liquidations to be paused + */ + cdp_paused?: boolean; + /** + * time interval in between each adjustment of stablecoin interest rate to + * help stablecoin price stability + */ + stablecoin_interest_rate_epoch?: DurationAmino | undefined; + /** + * used in formula to calculate stablecoin interest rate to help stablecoin + * price stability + */ + stablecoin_interest_rate_adjuster_coefficient?: string; +} +export interface ParamsAminoMsg { + type: "/Switcheo.carbon.cdp.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the module. */ +export interface ParamsSDKType { + interest_fee: string; + liquidation_fee: string; + stablecoin_mint_cap: string; + complete_liquidation_threshold: string; + minimum_close_factor: string; + small_liquidation_size: string; + stale_price_grace_period: DurationSDKType | undefined; + cdp_paused: boolean; + stablecoin_interest_rate_epoch: DurationSDKType | undefined; + stablecoin_interest_rate_adjuster_coefficient: string; +} +/** ParamsToUpdate allows optional fields for Params. */ +export interface ParamsToUpdate { + interestFee?: string; + liquidationFee?: string; + stablecoinMintCap?: string; + completeLiquidationThreshold?: string; + minimumCloseFactor?: string; + smallLiquidationSize?: string; + stalePriceGracePeriod?: Duration | undefined; + cdpPaused?: BoolValue | undefined; + stablecoinInterestRateEpoch?: Duration | undefined; + stablecoinInterestRateAdjusterCoefficient?: string; +} +export interface ParamsToUpdateProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.ParamsToUpdate"; + value: Uint8Array; +} +/** ParamsToUpdate allows optional fields for Params. */ +export interface ParamsToUpdateAmino { + interest_fee?: string; + liquidation_fee?: string; + stablecoin_mint_cap?: string; + complete_liquidation_threshold?: string; + minimum_close_factor?: string; + small_liquidation_size?: string; + stale_price_grace_period?: DurationAmino | undefined; + cdp_paused?: BoolValueAmino | undefined; + stablecoin_interest_rate_epoch?: DurationAmino | undefined; + stablecoin_interest_rate_adjuster_coefficient?: string; +} +export interface ParamsToUpdateAminoMsg { + type: "/Switcheo.carbon.cdp.ParamsToUpdate"; + value: ParamsToUpdateAmino; +} +/** ParamsToUpdate allows optional fields for Params. */ +export interface ParamsToUpdateSDKType { + interest_fee?: string; + liquidation_fee?: string; + stablecoin_mint_cap?: string; + complete_liquidation_threshold?: string; + minimum_close_factor?: string; + small_liquidation_size?: string; + stale_price_grace_period?: DurationSDKType | undefined; + cdp_paused?: BoolValueSDKType | undefined; + stablecoin_interest_rate_epoch?: DurationSDKType | undefined; + stablecoin_interest_rate_adjuster_coefficient?: string; +} +function createBaseParams(): Params { + return { + interestFee: "", + liquidationFee: "", + stablecoinMintCap: "", + completeLiquidationThreshold: "", + minimumCloseFactor: "", + smallLiquidationSize: "", + stalePriceGracePeriod: Duration.fromPartial({}), + cdpPaused: false, + stablecoinInterestRateEpoch: Duration.fromPartial({}), + stablecoinInterestRateAdjusterCoefficient: "" + }; +} +export const Params = { + typeUrl: "/Switcheo.carbon.cdp.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.interestFee !== "") { + writer.uint32(10).string(message.interestFee); + } + if (message.liquidationFee !== "") { + writer.uint32(18).string(message.liquidationFee); + } + if (message.stablecoinMintCap !== "") { + writer.uint32(34).string(message.stablecoinMintCap); + } + if (message.completeLiquidationThreshold !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.completeLiquidationThreshold, 18).atomics); + } + if (message.minimumCloseFactor !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.minimumCloseFactor, 18).atomics); + } + if (message.smallLiquidationSize !== "") { + writer.uint32(58).string(Decimal.fromUserInput(message.smallLiquidationSize, 18).atomics); + } + if (message.stalePriceGracePeriod !== undefined) { + Duration.encode(message.stalePriceGracePeriod, writer.uint32(66).fork()).ldelim(); + } + if (message.cdpPaused === true) { + writer.uint32(72).bool(message.cdpPaused); + } + if (message.stablecoinInterestRateEpoch !== undefined) { + Duration.encode(message.stablecoinInterestRateEpoch, writer.uint32(82).fork()).ldelim(); + } + if (message.stablecoinInterestRateAdjusterCoefficient !== "") { + writer.uint32(90).string(Decimal.fromUserInput(message.stablecoinInterestRateAdjusterCoefficient, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(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.interestFee = reader.string(); + break; + case 2: + message.liquidationFee = reader.string(); + break; + case 4: + message.stablecoinMintCap = reader.string(); + break; + case 5: + message.completeLiquidationThreshold = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.minimumCloseFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.smallLiquidationSize = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 8: + message.stalePriceGracePeriod = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 9: + message.cdpPaused = reader.bool(); + break; + case 10: + message.stablecoinInterestRateEpoch = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 11: + message.stablecoinInterestRateAdjusterCoefficient = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.interestFee = object.interestFee ?? ""; + message.liquidationFee = object.liquidationFee ?? ""; + message.stablecoinMintCap = object.stablecoinMintCap ?? ""; + message.completeLiquidationThreshold = object.completeLiquidationThreshold ?? ""; + message.minimumCloseFactor = object.minimumCloseFactor ?? ""; + message.smallLiquidationSize = object.smallLiquidationSize ?? ""; + message.stalePriceGracePeriod = object.stalePriceGracePeriod !== undefined && object.stalePriceGracePeriod !== null ? Duration.fromPartial(object.stalePriceGracePeriod) : undefined; + message.cdpPaused = object.cdpPaused ?? false; + message.stablecoinInterestRateEpoch = object.stablecoinInterestRateEpoch !== undefined && object.stablecoinInterestRateEpoch !== null ? Duration.fromPartial(object.stablecoinInterestRateEpoch) : undefined; + message.stablecoinInterestRateAdjusterCoefficient = object.stablecoinInterestRateAdjusterCoefficient ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.interest_fee !== undefined && object.interest_fee !== null) { + message.interestFee = object.interest_fee; + } + if (object.liquidation_fee !== undefined && object.liquidation_fee !== null) { + message.liquidationFee = object.liquidation_fee; + } + if (object.stablecoin_mint_cap !== undefined && object.stablecoin_mint_cap !== null) { + message.stablecoinMintCap = object.stablecoin_mint_cap; + } + if (object.complete_liquidation_threshold !== undefined && object.complete_liquidation_threshold !== null) { + message.completeLiquidationThreshold = object.complete_liquidation_threshold; + } + if (object.minimum_close_factor !== undefined && object.minimum_close_factor !== null) { + message.minimumCloseFactor = object.minimum_close_factor; + } + if (object.small_liquidation_size !== undefined && object.small_liquidation_size !== null) { + message.smallLiquidationSize = object.small_liquidation_size; + } + if (object.stale_price_grace_period !== undefined && object.stale_price_grace_period !== null) { + message.stalePriceGracePeriod = Duration.fromAmino(object.stale_price_grace_period); + } + if (object.cdp_paused !== undefined && object.cdp_paused !== null) { + message.cdpPaused = object.cdp_paused; + } + if (object.stablecoin_interest_rate_epoch !== undefined && object.stablecoin_interest_rate_epoch !== null) { + message.stablecoinInterestRateEpoch = Duration.fromAmino(object.stablecoin_interest_rate_epoch); + } + if (object.stablecoin_interest_rate_adjuster_coefficient !== undefined && object.stablecoin_interest_rate_adjuster_coefficient !== null) { + message.stablecoinInterestRateAdjusterCoefficient = object.stablecoin_interest_rate_adjuster_coefficient; + } + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + obj.interest_fee = message.interestFee === "" ? undefined : message.interestFee; + obj.liquidation_fee = message.liquidationFee === "" ? undefined : message.liquidationFee; + obj.stablecoin_mint_cap = message.stablecoinMintCap === "" ? undefined : message.stablecoinMintCap; + obj.complete_liquidation_threshold = message.completeLiquidationThreshold === "" ? undefined : message.completeLiquidationThreshold; + obj.minimum_close_factor = message.minimumCloseFactor === "" ? undefined : message.minimumCloseFactor; + obj.small_liquidation_size = message.smallLiquidationSize === "" ? undefined : message.smallLiquidationSize; + obj.stale_price_grace_period = message.stalePriceGracePeriod ? Duration.toAmino(message.stalePriceGracePeriod, useInterfaces) : undefined; + obj.cdp_paused = message.cdpPaused === false ? undefined : message.cdpPaused; + obj.stablecoin_interest_rate_epoch = message.stablecoinInterestRateEpoch ? Duration.toAmino(message.stablecoinInterestRateEpoch, useInterfaces) : undefined; + obj.stablecoin_interest_rate_adjuster_coefficient = message.stablecoinInterestRateAdjusterCoefficient === "" ? undefined : message.stablecoinInterestRateAdjusterCoefficient; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.Params", + value: Params.encode(message).finish() + }; + } +}; +function createBaseParamsToUpdate(): ParamsToUpdate { + return { + interestFee: undefined, + liquidationFee: undefined, + stablecoinMintCap: undefined, + completeLiquidationThreshold: undefined, + minimumCloseFactor: undefined, + smallLiquidationSize: undefined, + stalePriceGracePeriod: undefined, + cdpPaused: undefined, + stablecoinInterestRateEpoch: undefined, + stablecoinInterestRateAdjusterCoefficient: undefined + }; +} +export const ParamsToUpdate = { + typeUrl: "/Switcheo.carbon.cdp.ParamsToUpdate", + encode(message: ParamsToUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.interestFee !== undefined) { + writer.uint32(10).string(message.interestFee); + } + if (message.liquidationFee !== undefined) { + writer.uint32(18).string(message.liquidationFee); + } + if (message.stablecoinMintCap !== undefined) { + writer.uint32(34).string(message.stablecoinMintCap); + } + if (message.completeLiquidationThreshold !== undefined) { + writer.uint32(42).string(Decimal.fromUserInput(message.completeLiquidationThreshold, 18).atomics); + } + if (message.minimumCloseFactor !== undefined) { + writer.uint32(50).string(Decimal.fromUserInput(message.minimumCloseFactor, 18).atomics); + } + if (message.smallLiquidationSize !== undefined) { + writer.uint32(58).string(Decimal.fromUserInput(message.smallLiquidationSize, 18).atomics); + } + if (message.stalePriceGracePeriod !== undefined) { + Duration.encode(message.stalePriceGracePeriod, writer.uint32(66).fork()).ldelim(); + } + if (message.cdpPaused !== undefined) { + BoolValue.encode(message.cdpPaused, writer.uint32(74).fork()).ldelim(); + } + if (message.stablecoinInterestRateEpoch !== undefined) { + Duration.encode(message.stablecoinInterestRateEpoch, writer.uint32(82).fork()).ldelim(); + } + if (message.stablecoinInterestRateAdjusterCoefficient !== undefined) { + writer.uint32(90).string(Decimal.fromUserInput(message.stablecoinInterestRateAdjusterCoefficient, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ParamsToUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsToUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.interestFee = reader.string(); + break; + case 2: + message.liquidationFee = reader.string(); + break; + case 4: + message.stablecoinMintCap = reader.string(); + break; + case 5: + message.completeLiquidationThreshold = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.minimumCloseFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.smallLiquidationSize = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 8: + message.stalePriceGracePeriod = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 9: + message.cdpPaused = BoolValue.decode(reader, reader.uint32(), useInterfaces); + break; + case 10: + message.stablecoinInterestRateEpoch = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 11: + message.stablecoinInterestRateAdjusterCoefficient = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ParamsToUpdate { + const message = createBaseParamsToUpdate(); + message.interestFee = object.interestFee ?? undefined; + message.liquidationFee = object.liquidationFee ?? undefined; + message.stablecoinMintCap = object.stablecoinMintCap ?? undefined; + message.completeLiquidationThreshold = object.completeLiquidationThreshold ?? undefined; + message.minimumCloseFactor = object.minimumCloseFactor ?? undefined; + message.smallLiquidationSize = object.smallLiquidationSize ?? undefined; + message.stalePriceGracePeriod = object.stalePriceGracePeriod !== undefined && object.stalePriceGracePeriod !== null ? Duration.fromPartial(object.stalePriceGracePeriod) : undefined; + message.cdpPaused = object.cdpPaused !== undefined && object.cdpPaused !== null ? BoolValue.fromPartial(object.cdpPaused) : undefined; + message.stablecoinInterestRateEpoch = object.stablecoinInterestRateEpoch !== undefined && object.stablecoinInterestRateEpoch !== null ? Duration.fromPartial(object.stablecoinInterestRateEpoch) : undefined; + message.stablecoinInterestRateAdjusterCoefficient = object.stablecoinInterestRateAdjusterCoefficient ?? undefined; + return message; + }, + fromAmino(object: ParamsToUpdateAmino): ParamsToUpdate { + const message = createBaseParamsToUpdate(); + if (object.interest_fee !== undefined && object.interest_fee !== null) { + message.interestFee = object.interest_fee; + } + if (object.liquidation_fee !== undefined && object.liquidation_fee !== null) { + message.liquidationFee = object.liquidation_fee; + } + if (object.stablecoin_mint_cap !== undefined && object.stablecoin_mint_cap !== null) { + message.stablecoinMintCap = object.stablecoin_mint_cap; + } + if (object.complete_liquidation_threshold !== undefined && object.complete_liquidation_threshold !== null) { + message.completeLiquidationThreshold = object.complete_liquidation_threshold; + } + if (object.minimum_close_factor !== undefined && object.minimum_close_factor !== null) { + message.minimumCloseFactor = object.minimum_close_factor; + } + if (object.small_liquidation_size !== undefined && object.small_liquidation_size !== null) { + message.smallLiquidationSize = object.small_liquidation_size; + } + if (object.stale_price_grace_period !== undefined && object.stale_price_grace_period !== null) { + message.stalePriceGracePeriod = Duration.fromAmino(object.stale_price_grace_period); + } + if (object.cdp_paused !== undefined && object.cdp_paused !== null) { + message.cdpPaused = BoolValue.fromAmino(object.cdp_paused); + } + if (object.stablecoin_interest_rate_epoch !== undefined && object.stablecoin_interest_rate_epoch !== null) { + message.stablecoinInterestRateEpoch = Duration.fromAmino(object.stablecoin_interest_rate_epoch); + } + if (object.stablecoin_interest_rate_adjuster_coefficient !== undefined && object.stablecoin_interest_rate_adjuster_coefficient !== null) { + message.stablecoinInterestRateAdjusterCoefficient = object.stablecoin_interest_rate_adjuster_coefficient; + } + return message; + }, + toAmino(message: ParamsToUpdate, useInterfaces: boolean = false): ParamsToUpdateAmino { + const obj: any = {}; + obj.interest_fee = message.interestFee === null ? undefined : message.interestFee; + obj.liquidation_fee = message.liquidationFee === null ? undefined : message.liquidationFee; + obj.stablecoin_mint_cap = message.stablecoinMintCap === null ? undefined : message.stablecoinMintCap; + obj.complete_liquidation_threshold = message.completeLiquidationThreshold === null ? undefined : message.completeLiquidationThreshold; + obj.minimum_close_factor = message.minimumCloseFactor === null ? undefined : message.minimumCloseFactor; + obj.small_liquidation_size = message.smallLiquidationSize === null ? undefined : message.smallLiquidationSize; + obj.stale_price_grace_period = message.stalePriceGracePeriod ? Duration.toAmino(message.stalePriceGracePeriod, useInterfaces) : undefined; + obj.cdp_paused = message.cdpPaused ? BoolValue.toAmino(message.cdpPaused, useInterfaces) : undefined; + obj.stablecoin_interest_rate_epoch = message.stablecoinInterestRateEpoch ? Duration.toAmino(message.stablecoinInterestRateEpoch, useInterfaces) : undefined; + obj.stablecoin_interest_rate_adjuster_coefficient = message.stablecoinInterestRateAdjusterCoefficient === null ? undefined : message.stablecoinInterestRateAdjusterCoefficient; + return obj; + }, + fromAminoMsg(object: ParamsToUpdateAminoMsg): ParamsToUpdate { + return ParamsToUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsToUpdateProtoMsg, useInterfaces: boolean = false): ParamsToUpdate { + return ParamsToUpdate.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ParamsToUpdate): Uint8Array { + return ParamsToUpdate.encode(message).finish(); + }, + toProtoMsg(message: ParamsToUpdate): ParamsToUpdateProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.ParamsToUpdate", + value: ParamsToUpdate.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/query.rpc.Query.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/query.rpc.Query.ts new file mode 100644 index 000000000..6cee6ee0b --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/query.rpc.Query.ts @@ -0,0 +1,306 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryRateStrategyRequest, QueryRateStrategyResponse, QueryRateStrategyAllRequest, QueryRateStrategyAllResponse, QueryAccountDataRequest, QueryAccountDataResponse, QueryAccountCollateralRequest, QueryAccountCollateralResponse, QueryAccountCollateralAllRequest, QueryAccountCollateralAllResponse, QueryAccountDebtRequest, QueryAccountDebtResponse, QueryAccountDebtAllRequest, QueryAccountDebtAllResponse, QueryAccountStablecoinRequest, QueryAccountStablecoinResponse, QueryAssetRequest, QueryAssetResponse, QueryAssetAllRequest, QueryAssetAllResponse, QueryTokenDebtRequest, QueryTokenDebtResponse, QueryTokenDebtAllRequest, QueryTokenDebtAllResponse, QueryStablecoinDebtRequest, QueryStablecoinDebtResponse, QueryRewardSchemesAllRequest, QueryRewardSchemesAllResponse, QueryRewardDebtsRequest, QueryRewardDebtsResponse, QueryRewardDebtsAllRequest, QueryCdpPositionsRequest, QueryCdpPositionsResponse, QueryCdpPositionRequest, QueryCdpPositionResponse, QueryHealthFactorRequest, QueryHealthFactorResponse, QueryEModeRequest, QueryEModeResponse, QueryEModeAllRequest, QueryEModeAllResponse, QueryAccountEModeRequest, QueryAccountEModeResponse, QueryStablecoinInterestRequest, QueryStablecoinInterestResponse, QueryCDPLiquidationsAllRequest, QueryCDPLiquidationsAllResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + params(request?: QueryParamsRequest): Promise; + /** Queries a RateStrategy item. */ + rateStrategy(request: QueryRateStrategyRequest): Promise; + /** Queries a list of RateStrategy items. */ + rateStrategyAll(request?: QueryRateStrategyAllRequest): Promise; + /** Queries a AccountData items. */ + accountData(request: QueryAccountDataRequest): Promise; + /** Queries a list of AccountCollateral items. */ + accountCollateral(request: QueryAccountCollateralRequest): Promise; + /** Queries a list of AccountCollaterals items. */ + accountCollateralAll(request: QueryAccountCollateralAllRequest): Promise; + /** Queries a list of AccountDebt items. */ + accountDebt(request: QueryAccountDebtRequest): Promise; + /** Queries a list of AccountDebtAll items. */ + accountDebtAll(request: QueryAccountDebtAllRequest): Promise; + /** Queries a list of AccountStablecoin items. */ + accountStablecoin(request: QueryAccountStablecoinRequest): Promise; + /** Queries a list of Asset items. */ + asset(request: QueryAssetRequest): Promise; + /** Queries a list of AssetsAll items. */ + assetAll(request?: QueryAssetAllRequest): Promise; + /** Queries a list of TokenDebt items. */ + tokenDebt(request: QueryTokenDebtRequest): Promise; + /** Queries a list of TokenDebtsAll items. */ + tokenDebtAll(request?: QueryTokenDebtAllRequest): Promise; + /** Queries a list of StablecoinDebt items. */ + stablecoinDebt(request?: QueryStablecoinDebtRequest): Promise; + /** Queries a list of all RewardSchemes. */ + rewardSchemesAll(request?: QueryRewardSchemesAllRequest): Promise; + /** Queries a list of RewardDebt items for an address */ + rewardDebts(request: QueryRewardDebtsRequest): Promise; + /** Queries a list of all RewardDebts */ + rewardDebtsAll(request?: QueryRewardDebtsAllRequest): Promise; + /** Queries a list of CDP Positions */ + positionsAll(request: QueryCdpPositionsRequest): Promise; + position(request: QueryCdpPositionRequest): Promise; + healthFactor(request: QueryHealthFactorRequest): Promise; + /** Queries a list of EMode items. */ + eMode(request: QueryEModeRequest): Promise; + /** Queries a list of EModeAll items. */ + eModeAll(request?: QueryEModeAllRequest): Promise; + /** Queries a list of AccountEMode items. */ + accountEMode(request: QueryAccountEModeRequest): Promise; + /** Queries StablecoinInterest. */ + stablecoinInterest(request?: QueryStablecoinInterestRequest): Promise; + /** Queries a list of CDPLiquidations items. */ + cDPLiquidationsAll(request?: QueryCDPLiquidationsAllRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.rateStrategy = this.rateStrategy.bind(this); + this.rateStrategyAll = this.rateStrategyAll.bind(this); + this.accountData = this.accountData.bind(this); + this.accountCollateral = this.accountCollateral.bind(this); + this.accountCollateralAll = this.accountCollateralAll.bind(this); + this.accountDebt = this.accountDebt.bind(this); + this.accountDebtAll = this.accountDebtAll.bind(this); + this.accountStablecoin = this.accountStablecoin.bind(this); + this.asset = this.asset.bind(this); + this.assetAll = this.assetAll.bind(this); + this.tokenDebt = this.tokenDebt.bind(this); + this.tokenDebtAll = this.tokenDebtAll.bind(this); + this.stablecoinDebt = this.stablecoinDebt.bind(this); + this.rewardSchemesAll = this.rewardSchemesAll.bind(this); + this.rewardDebts = this.rewardDebts.bind(this); + this.rewardDebtsAll = this.rewardDebtsAll.bind(this); + this.positionsAll = this.positionsAll.bind(this); + this.position = this.position.bind(this); + this.healthFactor = this.healthFactor.bind(this); + this.eMode = this.eMode.bind(this); + this.eModeAll = this.eModeAll.bind(this); + this.accountEMode = this.accountEMode.bind(this); + this.stablecoinInterest = this.stablecoinInterest.bind(this); + this.cDPLiquidationsAll = this.cDPLiquidationsAll.bind(this); + } + params(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + rateStrategy(request: QueryRateStrategyRequest, useInterfaces: boolean = true): Promise { + const data = QueryRateStrategyRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "RateStrategy", data); + return promise.then(data => QueryRateStrategyResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + rateStrategyAll(request: QueryRateStrategyAllRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryRateStrategyAllRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "RateStrategyAll", data); + return promise.then(data => QueryRateStrategyAllResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + accountData(request: QueryAccountDataRequest, useInterfaces: boolean = true): Promise { + const data = QueryAccountDataRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "AccountData", data); + return promise.then(data => QueryAccountDataResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + accountCollateral(request: QueryAccountCollateralRequest, useInterfaces: boolean = true): Promise { + const data = QueryAccountCollateralRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "AccountCollateral", data); + return promise.then(data => QueryAccountCollateralResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + accountCollateralAll(request: QueryAccountCollateralAllRequest, useInterfaces: boolean = true): Promise { + const data = QueryAccountCollateralAllRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "AccountCollateralAll", data); + return promise.then(data => QueryAccountCollateralAllResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + accountDebt(request: QueryAccountDebtRequest, useInterfaces: boolean = true): Promise { + const data = QueryAccountDebtRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "AccountDebt", data); + return promise.then(data => QueryAccountDebtResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + accountDebtAll(request: QueryAccountDebtAllRequest, useInterfaces: boolean = true): Promise { + const data = QueryAccountDebtAllRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "AccountDebtAll", data); + return promise.then(data => QueryAccountDebtAllResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + accountStablecoin(request: QueryAccountStablecoinRequest, useInterfaces: boolean = true): Promise { + const data = QueryAccountStablecoinRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "AccountStablecoin", data); + return promise.then(data => QueryAccountStablecoinResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + asset(request: QueryAssetRequest, useInterfaces: boolean = true): Promise { + const data = QueryAssetRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "Asset", data); + return promise.then(data => QueryAssetResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + assetAll(request: QueryAssetAllRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryAssetAllRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "AssetAll", data); + return promise.then(data => QueryAssetAllResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + tokenDebt(request: QueryTokenDebtRequest, useInterfaces: boolean = true): Promise { + const data = QueryTokenDebtRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "TokenDebt", data); + return promise.then(data => QueryTokenDebtResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + tokenDebtAll(request: QueryTokenDebtAllRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryTokenDebtAllRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "TokenDebtAll", data); + return promise.then(data => QueryTokenDebtAllResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + stablecoinDebt(request: QueryStablecoinDebtRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryStablecoinDebtRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "StablecoinDebt", data); + return promise.then(data => QueryStablecoinDebtResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + rewardSchemesAll(request: QueryRewardSchemesAllRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryRewardSchemesAllRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "RewardSchemesAll", data); + return promise.then(data => QueryRewardSchemesAllResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + rewardDebts(request: QueryRewardDebtsRequest, useInterfaces: boolean = true): Promise { + const data = QueryRewardDebtsRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "RewardDebts", data); + return promise.then(data => QueryRewardDebtsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + rewardDebtsAll(request: QueryRewardDebtsAllRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryRewardDebtsAllRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "RewardDebtsAll", data); + return promise.then(data => QueryRewardDebtsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + positionsAll(request: QueryCdpPositionsRequest, useInterfaces: boolean = true): Promise { + const data = QueryCdpPositionsRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "PositionsAll", data); + return promise.then(data => QueryCdpPositionsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + position(request: QueryCdpPositionRequest, useInterfaces: boolean = true): Promise { + const data = QueryCdpPositionRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "Position", data); + return promise.then(data => QueryCdpPositionResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + healthFactor(request: QueryHealthFactorRequest, useInterfaces: boolean = true): Promise { + const data = QueryHealthFactorRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "HealthFactor", data); + return promise.then(data => QueryHealthFactorResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + eMode(request: QueryEModeRequest, useInterfaces: boolean = true): Promise { + const data = QueryEModeRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "EMode", data); + return promise.then(data => QueryEModeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + eModeAll(request: QueryEModeAllRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryEModeAllRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "EModeAll", data); + return promise.then(data => QueryEModeAllResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + accountEMode(request: QueryAccountEModeRequest, useInterfaces: boolean = true): Promise { + const data = QueryAccountEModeRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "AccountEMode", data); + return promise.then(data => QueryAccountEModeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + stablecoinInterest(request: QueryStablecoinInterestRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryStablecoinInterestRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "StablecoinInterest", data); + return promise.then(data => QueryStablecoinInterestResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + cDPLiquidationsAll(request: QueryCDPLiquidationsAllRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryCDPLiquidationsAllRequest.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Query", "CDPLiquidationsAll", data); + return promise.then(data => QueryCDPLiquidationsAllResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + }, + rateStrategy(request: QueryRateStrategyRequest, useInterfaces: boolean = true): Promise { + return queryService.rateStrategy(request, useInterfaces); + }, + rateStrategyAll(request?: QueryRateStrategyAllRequest, useInterfaces: boolean = true): Promise { + return queryService.rateStrategyAll(request, useInterfaces); + }, + accountData(request: QueryAccountDataRequest, useInterfaces: boolean = true): Promise { + return queryService.accountData(request, useInterfaces); + }, + accountCollateral(request: QueryAccountCollateralRequest, useInterfaces: boolean = true): Promise { + return queryService.accountCollateral(request, useInterfaces); + }, + accountCollateralAll(request: QueryAccountCollateralAllRequest, useInterfaces: boolean = true): Promise { + return queryService.accountCollateralAll(request, useInterfaces); + }, + accountDebt(request: QueryAccountDebtRequest, useInterfaces: boolean = true): Promise { + return queryService.accountDebt(request, useInterfaces); + }, + accountDebtAll(request: QueryAccountDebtAllRequest, useInterfaces: boolean = true): Promise { + return queryService.accountDebtAll(request, useInterfaces); + }, + accountStablecoin(request: QueryAccountStablecoinRequest, useInterfaces: boolean = true): Promise { + return queryService.accountStablecoin(request, useInterfaces); + }, + asset(request: QueryAssetRequest, useInterfaces: boolean = true): Promise { + return queryService.asset(request, useInterfaces); + }, + assetAll(request?: QueryAssetAllRequest, useInterfaces: boolean = true): Promise { + return queryService.assetAll(request, useInterfaces); + }, + tokenDebt(request: QueryTokenDebtRequest, useInterfaces: boolean = true): Promise { + return queryService.tokenDebt(request, useInterfaces); + }, + tokenDebtAll(request?: QueryTokenDebtAllRequest, useInterfaces: boolean = true): Promise { + return queryService.tokenDebtAll(request, useInterfaces); + }, + stablecoinDebt(request?: QueryStablecoinDebtRequest, useInterfaces: boolean = true): Promise { + return queryService.stablecoinDebt(request, useInterfaces); + }, + rewardSchemesAll(request?: QueryRewardSchemesAllRequest, useInterfaces: boolean = true): Promise { + return queryService.rewardSchemesAll(request, useInterfaces); + }, + rewardDebts(request: QueryRewardDebtsRequest, useInterfaces: boolean = true): Promise { + return queryService.rewardDebts(request, useInterfaces); + }, + rewardDebtsAll(request?: QueryRewardDebtsAllRequest, useInterfaces: boolean = true): Promise { + return queryService.rewardDebtsAll(request, useInterfaces); + }, + positionsAll(request: QueryCdpPositionsRequest, useInterfaces: boolean = true): Promise { + return queryService.positionsAll(request, useInterfaces); + }, + position(request: QueryCdpPositionRequest, useInterfaces: boolean = true): Promise { + return queryService.position(request, useInterfaces); + }, + healthFactor(request: QueryHealthFactorRequest, useInterfaces: boolean = true): Promise { + return queryService.healthFactor(request, useInterfaces); + }, + eMode(request: QueryEModeRequest, useInterfaces: boolean = true): Promise { + return queryService.eMode(request, useInterfaces); + }, + eModeAll(request?: QueryEModeAllRequest, useInterfaces: boolean = true): Promise { + return queryService.eModeAll(request, useInterfaces); + }, + accountEMode(request: QueryAccountEModeRequest, useInterfaces: boolean = true): Promise { + return queryService.accountEMode(request, useInterfaces); + }, + stablecoinInterest(request?: QueryStablecoinInterestRequest, useInterfaces: boolean = true): Promise { + return queryService.stablecoinInterest(request, useInterfaces); + }, + cDPLiquidationsAll(request?: QueryCDPLiquidationsAllRequest, useInterfaces: boolean = true): Promise { + return queryService.cDPLiquidationsAll(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/query.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/query.ts new file mode 100644 index 000000000..8d05682eb --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/query.ts @@ -0,0 +1,4786 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { RateStrategyParams, RateStrategyParamsAmino, RateStrategyParamsSDKType } from "./rate_strategy_params"; +import { AssetParamsAPI, AssetParamsAPIAmino, AssetParamsAPISDKType } from "./asset_params"; +import { DebtInfo, DebtInfoAmino, DebtInfoSDKType } from "./debt_info"; +import { StablecoinDebtInfo, StablecoinDebtInfoAmino, StablecoinDebtInfoSDKType } from "./stablecoin_debt_info"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { RewardScheme, RewardSchemeAmino, RewardSchemeSDKType, RewardDebt, RewardDebtAmino, RewardDebtSDKType } from "./reward_scheme"; +import { EModeCategory, EModeCategoryAmino, EModeCategorySDKType } from "./e_mode_category"; +import { StablecoinInterestInfo, StablecoinInterestInfoAmino, StablecoinInterestInfoSDKType } from "./stablecoin_interest_info"; +import { CDPLiquidations, CDPLiquidationsAmino, CDPLiquidationsSDKType } from "./cdp_liquidations"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params?: ParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +export interface QueryRateStrategyRequest { + name: string; +} +export interface QueryRateStrategyRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyRequest"; + value: Uint8Array; +} +export interface QueryRateStrategyRequestAmino { + name?: string; +} +export interface QueryRateStrategyRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryRateStrategyRequest"; + value: QueryRateStrategyRequestAmino; +} +export interface QueryRateStrategyRequestSDKType { + name: string; +} +export interface QueryRateStrategyResponse { + rateStrategyParams?: RateStrategyParams | undefined; +} +export interface QueryRateStrategyResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyResponse"; + value: Uint8Array; +} +export interface QueryRateStrategyResponseAmino { + rate_strategy_params?: RateStrategyParamsAmino | undefined; +} +export interface QueryRateStrategyResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryRateStrategyResponse"; + value: QueryRateStrategyResponseAmino; +} +export interface QueryRateStrategyResponseSDKType { + rate_strategy_params?: RateStrategyParamsSDKType | undefined; +} +export interface QueryRateStrategyAllRequest { + pagination?: PageRequest | undefined; +} +export interface QueryRateStrategyAllRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyAllRequest"; + value: Uint8Array; +} +export interface QueryRateStrategyAllRequestAmino { + pagination?: PageRequestAmino | undefined; +} +export interface QueryRateStrategyAllRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryRateStrategyAllRequest"; + value: QueryRateStrategyAllRequestAmino; +} +export interface QueryRateStrategyAllRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +export interface QueryRateStrategyAllResponse { + rateStrategyParamsAll: RateStrategyParams[]; + pagination?: PageResponse | undefined; +} +export interface QueryRateStrategyAllResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyAllResponse"; + value: Uint8Array; +} +export interface QueryRateStrategyAllResponseAmino { + rate_strategy_params_all?: RateStrategyParamsAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryRateStrategyAllResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryRateStrategyAllResponse"; + value: QueryRateStrategyAllResponseAmino; +} +export interface QueryRateStrategyAllResponseSDKType { + rate_strategy_params_all: RateStrategyParamsSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryAccountDataRequest { + address: string; +} +export interface QueryAccountDataRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDataRequest"; + value: Uint8Array; +} +export interface QueryAccountDataRequestAmino { + address?: string; +} +export interface QueryAccountDataRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountDataRequest"; + value: QueryAccountDataRequestAmino; +} +export interface QueryAccountDataRequestSDKType { + address: string; +} +export interface QueryAccountDataResponse { + totalCollateralsUsd: string; + totalDebtsUsd: string; + availableBorrowsUsd: string; + currLiquidationThreshold: string; +} +export interface QueryAccountDataResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDataResponse"; + value: Uint8Array; +} +export interface QueryAccountDataResponseAmino { + total_collaterals_usd?: string; + total_debts_usd?: string; + available_borrows_usd?: string; + curr_liquidation_threshold?: string; +} +export interface QueryAccountDataResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountDataResponse"; + value: QueryAccountDataResponseAmino; +} +export interface QueryAccountDataResponseSDKType { + total_collaterals_usd: string; + total_debts_usd: string; + available_borrows_usd: string; + curr_liquidation_threshold: string; +} +export interface QueryAccountCollateralRequest { + address: string; + cibtDenom: string; +} +export interface QueryAccountCollateralRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralRequest"; + value: Uint8Array; +} +export interface QueryAccountCollateralRequestAmino { + address?: string; + cibt_denom?: string; +} +export interface QueryAccountCollateralRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountCollateralRequest"; + value: QueryAccountCollateralRequestAmino; +} +export interface QueryAccountCollateralRequestSDKType { + address: string; + cibt_denom: string; +} +export interface QueryAccountCollateralResponse { + collateral?: Collateral | undefined; +} +export interface QueryAccountCollateralResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralResponse"; + value: Uint8Array; +} +export interface QueryAccountCollateralResponseAmino { + collateral?: CollateralAmino | undefined; +} +export interface QueryAccountCollateralResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountCollateralResponse"; + value: QueryAccountCollateralResponseAmino; +} +export interface QueryAccountCollateralResponseSDKType { + collateral?: CollateralSDKType | undefined; +} +export interface QueryAccountCollateralAllRequest { + address: string; + pagination?: PageRequest | undefined; +} +export interface QueryAccountCollateralAllRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralAllRequest"; + value: Uint8Array; +} +export interface QueryAccountCollateralAllRequestAmino { + address?: string; + pagination?: PageRequestAmino | undefined; +} +export interface QueryAccountCollateralAllRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountCollateralAllRequest"; + value: QueryAccountCollateralAllRequestAmino; +} +export interface QueryAccountCollateralAllRequestSDKType { + address: string; + pagination?: PageRequestSDKType | undefined; +} +export interface QueryAccountCollateralAllResponse { + collaterals: Collateral[]; + pagination?: PageResponse | undefined; +} +export interface QueryAccountCollateralAllResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralAllResponse"; + value: Uint8Array; +} +export interface QueryAccountCollateralAllResponseAmino { + collaterals?: CollateralAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryAccountCollateralAllResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountCollateralAllResponse"; + value: QueryAccountCollateralAllResponseAmino; +} +export interface QueryAccountCollateralAllResponseSDKType { + collaterals: CollateralSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface Collateral { + denom: string; + cibtDenom: string; + collateralAmount: string; +} +export interface CollateralProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.Collateral"; + value: Uint8Array; +} +export interface CollateralAmino { + denom?: string; + cibt_denom?: string; + collateral_amount?: string; +} +export interface CollateralAminoMsg { + type: "/Switcheo.carbon.cdp.Collateral"; + value: CollateralAmino; +} +export interface CollateralSDKType { + denom: string; + cibt_denom: string; + collateral_amount: string; +} +export interface QueryAccountDebtRequest { + address: string; + denom: string; +} +export interface QueryAccountDebtRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtRequest"; + value: Uint8Array; +} +export interface QueryAccountDebtRequestAmino { + address?: string; + denom?: string; +} +export interface QueryAccountDebtRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountDebtRequest"; + value: QueryAccountDebtRequestAmino; +} +export interface QueryAccountDebtRequestSDKType { + address: string; + denom: string; +} +export interface QueryAccountDebtResponse { + debt?: Debt | undefined; +} +export interface QueryAccountDebtResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtResponse"; + value: Uint8Array; +} +export interface QueryAccountDebtResponseAmino { + debt?: DebtAmino | undefined; +} +export interface QueryAccountDebtResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountDebtResponse"; + value: QueryAccountDebtResponseAmino; +} +export interface QueryAccountDebtResponseSDKType { + debt?: DebtSDKType | undefined; +} +export interface QueryAccountDebtAllRequest { + address: string; + pagination?: PageRequest | undefined; +} +export interface QueryAccountDebtAllRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtAllRequest"; + value: Uint8Array; +} +export interface QueryAccountDebtAllRequestAmino { + address?: string; + pagination?: PageRequestAmino | undefined; +} +export interface QueryAccountDebtAllRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountDebtAllRequest"; + value: QueryAccountDebtAllRequestAmino; +} +export interface QueryAccountDebtAllRequestSDKType { + address: string; + pagination?: PageRequestSDKType | undefined; +} +export interface QueryAccountDebtAllResponse { + debts: Debt[]; + pagination?: PageResponse | undefined; +} +export interface QueryAccountDebtAllResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtAllResponse"; + value: Uint8Array; +} +export interface QueryAccountDebtAllResponseAmino { + debts?: DebtAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryAccountDebtAllResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountDebtAllResponse"; + value: QueryAccountDebtAllResponseAmino; +} +export interface QueryAccountDebtAllResponseSDKType { + debts: DebtSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface Debt { + denom: string; + principal: string; + initialCumulativeInterestMultiplier: string; +} +export interface DebtProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.Debt"; + value: Uint8Array; +} +export interface DebtAmino { + denom?: string; + principal?: string; + initial_cumulative_interest_multiplier?: string; +} +export interface DebtAminoMsg { + type: "/Switcheo.carbon.cdp.Debt"; + value: DebtAmino; +} +export interface DebtSDKType { + denom: string; + principal: string; + initial_cumulative_interest_multiplier: string; +} +export interface QueryAccountStablecoinRequest { + address: string; +} +export interface QueryAccountStablecoinRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountStablecoinRequest"; + value: Uint8Array; +} +export interface QueryAccountStablecoinRequestAmino { + address?: string; +} +export interface QueryAccountStablecoinRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountStablecoinRequest"; + value: QueryAccountStablecoinRequestAmino; +} +export interface QueryAccountStablecoinRequestSDKType { + address: string; +} +export interface QueryAccountStablecoinResponse { + principal: string; + interest: string; + initialCumulativeInterestMultiplier: string; +} +export interface QueryAccountStablecoinResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountStablecoinResponse"; + value: Uint8Array; +} +export interface QueryAccountStablecoinResponseAmino { + principal?: string; + interest?: string; + initial_cumulative_interest_multiplier?: string; +} +export interface QueryAccountStablecoinResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountStablecoinResponse"; + value: QueryAccountStablecoinResponseAmino; +} +export interface QueryAccountStablecoinResponseSDKType { + principal: string; + interest: string; + initial_cumulative_interest_multiplier: string; +} +export interface QueryAssetRequest { + denom: string; +} +export interface QueryAssetRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetRequest"; + value: Uint8Array; +} +export interface QueryAssetRequestAmino { + denom?: string; +} +export interface QueryAssetRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAssetRequest"; + value: QueryAssetRequestAmino; +} +export interface QueryAssetRequestSDKType { + denom: string; +} +export interface QueryAssetResponse { + assetParams?: AssetParamsAPI | undefined; +} +export interface QueryAssetResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetResponse"; + value: Uint8Array; +} +export interface QueryAssetResponseAmino { + asset_params?: AssetParamsAPIAmino | undefined; +} +export interface QueryAssetResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAssetResponse"; + value: QueryAssetResponseAmino; +} +export interface QueryAssetResponseSDKType { + asset_params?: AssetParamsAPISDKType | undefined; +} +export interface QueryAssetAllRequest { + pagination?: PageRequest | undefined; +} +export interface QueryAssetAllRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetAllRequest"; + value: Uint8Array; +} +export interface QueryAssetAllRequestAmino { + pagination?: PageRequestAmino | undefined; +} +export interface QueryAssetAllRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAssetAllRequest"; + value: QueryAssetAllRequestAmino; +} +export interface QueryAssetAllRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +export interface QueryAssetAllResponse { + assetParamsAll: AssetParamsAPI[]; + pagination?: PageResponse | undefined; +} +export interface QueryAssetAllResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetAllResponse"; + value: Uint8Array; +} +export interface QueryAssetAllResponseAmino { + asset_params_all?: AssetParamsAPIAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryAssetAllResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAssetAllResponse"; + value: QueryAssetAllResponseAmino; +} +export interface QueryAssetAllResponseSDKType { + asset_params_all: AssetParamsAPISDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryTokenDebtRequest { + denom: string; +} +export interface QueryTokenDebtRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtRequest"; + value: Uint8Array; +} +export interface QueryTokenDebtRequestAmino { + denom?: string; +} +export interface QueryTokenDebtRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryTokenDebtRequest"; + value: QueryTokenDebtRequestAmino; +} +export interface QueryTokenDebtRequestSDKType { + denom: string; +} +export interface QueryTokenDebtResponse { + debtInfo?: DebtInfo | undefined; +} +export interface QueryTokenDebtResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtResponse"; + value: Uint8Array; +} +export interface QueryTokenDebtResponseAmino { + debt_info?: DebtInfoAmino | undefined; +} +export interface QueryTokenDebtResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryTokenDebtResponse"; + value: QueryTokenDebtResponseAmino; +} +export interface QueryTokenDebtResponseSDKType { + debt_info?: DebtInfoSDKType | undefined; +} +export interface QueryTokenDebtAllRequest { + pagination?: PageRequest | undefined; +} +export interface QueryTokenDebtAllRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtAllRequest"; + value: Uint8Array; +} +export interface QueryTokenDebtAllRequestAmino { + pagination?: PageRequestAmino | undefined; +} +export interface QueryTokenDebtAllRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryTokenDebtAllRequest"; + value: QueryTokenDebtAllRequestAmino; +} +export interface QueryTokenDebtAllRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +export interface QueryTokenDebtAllResponse { + debtInfosAll: DebtInfo[]; + pagination?: PageResponse | undefined; +} +export interface QueryTokenDebtAllResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtAllResponse"; + value: Uint8Array; +} +export interface QueryTokenDebtAllResponseAmino { + debt_infos_all?: DebtInfoAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryTokenDebtAllResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryTokenDebtAllResponse"; + value: QueryTokenDebtAllResponseAmino; +} +export interface QueryTokenDebtAllResponseSDKType { + debt_infos_all: DebtInfoSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryStablecoinDebtRequest {} +export interface QueryStablecoinDebtRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinDebtRequest"; + value: Uint8Array; +} +export interface QueryStablecoinDebtRequestAmino {} +export interface QueryStablecoinDebtRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryStablecoinDebtRequest"; + value: QueryStablecoinDebtRequestAmino; +} +export interface QueryStablecoinDebtRequestSDKType {} +export interface QueryStablecoinDebtResponse { + stablecoinDebtInfo?: StablecoinDebtInfo | undefined; +} +export interface QueryStablecoinDebtResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinDebtResponse"; + value: Uint8Array; +} +export interface QueryStablecoinDebtResponseAmino { + stablecoin_debt_info?: StablecoinDebtInfoAmino | undefined; +} +export interface QueryStablecoinDebtResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryStablecoinDebtResponse"; + value: QueryStablecoinDebtResponseAmino; +} +export interface QueryStablecoinDebtResponseSDKType { + stablecoin_debt_info?: StablecoinDebtInfoSDKType | undefined; +} +export interface CdpPositionItem { + address: string; + denom: string; + cibtDenom: string; + healthFactor: string; + collateralAmount: string; + borrowAmount: string; + mintDenom: string; + mintAmount: string; +} +export interface CdpPositionItemProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.CdpPositionItem"; + value: Uint8Array; +} +export interface CdpPositionItemAmino { + address?: string; + denom?: string; + cibt_denom?: string; + health_factor?: string; + collateral_amount?: string; + borrow_amount?: string; + mint_denom?: string; + mint_amount?: string; +} +export interface CdpPositionItemAminoMsg { + type: "/Switcheo.carbon.cdp.CdpPositionItem"; + value: CdpPositionItemAmino; +} +export interface CdpPositionItemSDKType { + address: string; + denom: string; + cibt_denom: string; + health_factor: string; + collateral_amount: string; + borrow_amount: string; + mint_denom: string; + mint_amount: string; +} +export interface CdpPosition { + address: string; + healthFactor: string; + collateral: Coin[]; + borrow: Coin[]; + mint: Coin[]; +} +export interface CdpPositionProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.CdpPosition"; + value: Uint8Array; +} +export interface CdpPositionAmino { + address?: string; + health_factor?: string; + collateral?: CoinAmino[]; + borrow?: CoinAmino[]; + mint?: CoinAmino[]; +} +export interface CdpPositionAminoMsg { + type: "/Switcheo.carbon.cdp.CdpPosition"; + value: CdpPositionAmino; +} +export interface CdpPositionSDKType { + address: string; + health_factor: string; + collateral: CoinSDKType[]; + borrow: CoinSDKType[]; + mint: CoinSDKType[]; +} +export interface QueryCdpPositionRequest { + address: string; +} +export interface QueryCdpPositionRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionRequest"; + value: Uint8Array; +} +export interface QueryCdpPositionRequestAmino { + address?: string; +} +export interface QueryCdpPositionRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryCdpPositionRequest"; + value: QueryCdpPositionRequestAmino; +} +export interface QueryCdpPositionRequestSDKType { + address: string; +} +export interface QueryCdpPositionResponse { + position?: CdpPosition | undefined; +} +export interface QueryCdpPositionResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionResponse"; + value: Uint8Array; +} +export interface QueryCdpPositionResponseAmino { + position?: CdpPositionAmino | undefined; +} +export interface QueryCdpPositionResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryCdpPositionResponse"; + value: QueryCdpPositionResponseAmino; +} +export interface QueryCdpPositionResponseSDKType { + position?: CdpPositionSDKType | undefined; +} +export interface QueryCdpPositionsRequest { + pagination?: PageRequest | undefined; + maxHealthFactor?: string; + minHealthFactor?: string; +} +export interface QueryCdpPositionsRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionsRequest"; + value: Uint8Array; +} +export interface QueryCdpPositionsRequestAmino { + pagination?: PageRequestAmino | undefined; + max_health_factor?: string; + min_health_factor?: string; +} +export interface QueryCdpPositionsRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryCdpPositionsRequest"; + value: QueryCdpPositionsRequestAmino; +} +export interface QueryCdpPositionsRequestSDKType { + pagination?: PageRequestSDKType | undefined; + max_health_factor?: string; + min_health_factor?: string; +} +export interface QueryCdpPositionsResponse { + positions: CdpPosition[]; + pagination?: PageResponse | undefined; +} +export interface QueryCdpPositionsResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionsResponse"; + value: Uint8Array; +} +export interface QueryCdpPositionsResponseAmino { + positions?: CdpPositionAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryCdpPositionsResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryCdpPositionsResponse"; + value: QueryCdpPositionsResponseAmino; +} +export interface QueryCdpPositionsResponseSDKType { + positions: CdpPositionSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryRewardSchemesAllRequest { + pagination?: PageRequest | undefined; +} +export interface QueryRewardSchemesAllRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardSchemesAllRequest"; + value: Uint8Array; +} +export interface QueryRewardSchemesAllRequestAmino { + pagination?: PageRequestAmino | undefined; +} +export interface QueryRewardSchemesAllRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryRewardSchemesAllRequest"; + value: QueryRewardSchemesAllRequestAmino; +} +export interface QueryRewardSchemesAllRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +export interface QueryRewardSchemesAllResponse { + rewardSchemes: RewardScheme[]; + pagination?: PageResponse | undefined; +} +export interface QueryRewardSchemesAllResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardSchemesAllResponse"; + value: Uint8Array; +} +export interface QueryRewardSchemesAllResponseAmino { + reward_schemes?: RewardSchemeAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryRewardSchemesAllResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryRewardSchemesAllResponse"; + value: QueryRewardSchemesAllResponseAmino; +} +export interface QueryRewardSchemesAllResponseSDKType { + reward_schemes: RewardSchemeSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryRewardDebtsRequest { + address: string; + pagination?: PageRequest | undefined; +} +export interface QueryRewardDebtsRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardDebtsRequest"; + value: Uint8Array; +} +export interface QueryRewardDebtsRequestAmino { + address?: string; + pagination?: PageRequestAmino | undefined; +} +export interface QueryRewardDebtsRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryRewardDebtsRequest"; + value: QueryRewardDebtsRequestAmino; +} +export interface QueryRewardDebtsRequestSDKType { + address: string; + pagination?: PageRequestSDKType | undefined; +} +export interface QueryRewardDebtsResponse { + rewardDebts: RewardDebt[]; + pagination?: PageResponse | undefined; +} +export interface QueryRewardDebtsResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardDebtsResponse"; + value: Uint8Array; +} +export interface QueryRewardDebtsResponseAmino { + reward_debts?: RewardDebtAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryRewardDebtsResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryRewardDebtsResponse"; + value: QueryRewardDebtsResponseAmino; +} +export interface QueryRewardDebtsResponseSDKType { + reward_debts: RewardDebtSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryRewardDebtsAllRequest { + pagination?: PageRequest | undefined; +} +export interface QueryRewardDebtsAllRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardDebtsAllRequest"; + value: Uint8Array; +} +export interface QueryRewardDebtsAllRequestAmino { + pagination?: PageRequestAmino | undefined; +} +export interface QueryRewardDebtsAllRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryRewardDebtsAllRequest"; + value: QueryRewardDebtsAllRequestAmino; +} +export interface QueryRewardDebtsAllRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +export interface QueryEModeAllRequest { + pagination?: PageRequest | undefined; +} +export interface QueryEModeAllRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeAllRequest"; + value: Uint8Array; +} +export interface QueryEModeAllRequestAmino { + pagination?: PageRequestAmino | undefined; +} +export interface QueryEModeAllRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryEModeAllRequest"; + value: QueryEModeAllRequestAmino; +} +export interface QueryEModeAllRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +export interface QueryEModeAllResponse { + eModeCategories: EModeCategory[]; + pagination?: PageResponse | undefined; +} +export interface QueryEModeAllResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeAllResponse"; + value: Uint8Array; +} +export interface QueryEModeAllResponseAmino { + e_mode_categories?: EModeCategoryAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryEModeAllResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryEModeAllResponse"; + value: QueryEModeAllResponseAmino; +} +export interface QueryEModeAllResponseSDKType { + e_mode_categories: EModeCategorySDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryStablecoinInterestRequest {} +export interface QueryStablecoinInterestRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinInterestRequest"; + value: Uint8Array; +} +export interface QueryStablecoinInterestRequestAmino {} +export interface QueryStablecoinInterestRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryStablecoinInterestRequest"; + value: QueryStablecoinInterestRequestAmino; +} +export interface QueryStablecoinInterestRequestSDKType {} +export interface QueryStablecoinInterestResponse { + stablecoinInterestInfo?: StablecoinInterestInfo | undefined; +} +export interface QueryStablecoinInterestResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinInterestResponse"; + value: Uint8Array; +} +export interface QueryStablecoinInterestResponseAmino { + stablecoin_interest_info?: StablecoinInterestInfoAmino | undefined; +} +export interface QueryStablecoinInterestResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryStablecoinInterestResponse"; + value: QueryStablecoinInterestResponseAmino; +} +export interface QueryStablecoinInterestResponseSDKType { + stablecoin_interest_info?: StablecoinInterestInfoSDKType | undefined; +} +export interface QueryEModeRequest { + name: string; +} +export interface QueryEModeRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeRequest"; + value: Uint8Array; +} +export interface QueryEModeRequestAmino { + name?: string; +} +export interface QueryEModeRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryEModeRequest"; + value: QueryEModeRequestAmino; +} +export interface QueryEModeRequestSDKType { + name: string; +} +export interface QueryEModeResponse { + eModeCategory: EModeCategory | undefined; +} +export interface QueryEModeResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeResponse"; + value: Uint8Array; +} +export interface QueryEModeResponseAmino { + e_mode_category?: EModeCategoryAmino | undefined; +} +export interface QueryEModeResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryEModeResponse"; + value: QueryEModeResponseAmino; +} +export interface QueryEModeResponseSDKType { + e_mode_category: EModeCategorySDKType | undefined; +} +export interface QueryHealthFactorRequest { + address: string; +} +export interface QueryHealthFactorRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryHealthFactorRequest"; + value: Uint8Array; +} +export interface QueryHealthFactorRequestAmino { + address?: string; +} +export interface QueryHealthFactorRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryHealthFactorRequest"; + value: QueryHealthFactorRequestAmino; +} +export interface QueryHealthFactorRequestSDKType { + address: string; +} +export interface QueryHealthFactorResponse { + healthFactor: string; +} +export interface QueryHealthFactorResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryHealthFactorResponse"; + value: Uint8Array; +} +export interface QueryHealthFactorResponseAmino { + health_factor?: string; +} +export interface QueryHealthFactorResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryHealthFactorResponse"; + value: QueryHealthFactorResponseAmino; +} +export interface QueryHealthFactorResponseSDKType { + health_factor: string; +} +export interface QueryAccountEModeRequest { + address: string; +} +export interface QueryAccountEModeRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountEModeRequest"; + value: Uint8Array; +} +export interface QueryAccountEModeRequestAmino { + address?: string; +} +export interface QueryAccountEModeRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountEModeRequest"; + value: QueryAccountEModeRequestAmino; +} +export interface QueryAccountEModeRequestSDKType { + address: string; +} +export interface QueryAccountEModeResponse { + eModeCategoryName: string; +} +export interface QueryAccountEModeResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountEModeResponse"; + value: Uint8Array; +} +export interface QueryAccountEModeResponseAmino { + e_mode_category_name?: string; +} +export interface QueryAccountEModeResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryAccountEModeResponse"; + value: QueryAccountEModeResponseAmino; +} +export interface QueryAccountEModeResponseSDKType { + e_mode_category_name: string; +} +export interface QueryCDPLiquidationsAllRequest { + pagination?: PageRequest | undefined; +} +export interface QueryCDPLiquidationsAllRequestProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryCDPLiquidationsAllRequest"; + value: Uint8Array; +} +export interface QueryCDPLiquidationsAllRequestAmino { + pagination?: PageRequestAmino | undefined; +} +export interface QueryCDPLiquidationsAllRequestAminoMsg { + type: "/Switcheo.carbon.cdp.QueryCDPLiquidationsAllRequest"; + value: QueryCDPLiquidationsAllRequestAmino; +} +export interface QueryCDPLiquidationsAllRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +export interface QueryCDPLiquidationsAllResponse { + cdpLiquidationsAll: CDPLiquidations[]; + pagination?: PageResponse | undefined; +} +export interface QueryCDPLiquidationsAllResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.QueryCDPLiquidationsAllResponse"; + value: Uint8Array; +} +export interface QueryCDPLiquidationsAllResponseAmino { + cdp_liquidations_all?: CDPLiquidationsAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryCDPLiquidationsAllResponseAminoMsg { + type: "/Switcheo.carbon.cdp.QueryCDPLiquidationsAllResponse"; + value: QueryCDPLiquidationsAllResponseAmino; +} +export interface QueryCDPLiquidationsAllResponseSDKType { + cdp_liquidations_all: CDPLiquidationsSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryRateStrategyRequest(): QueryRateStrategyRequest { + return { + name: "" + }; +} +export const QueryRateStrategyRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyRequest", + encode(message: QueryRateStrategyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRateStrategyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRateStrategyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRateStrategyRequest { + const message = createBaseQueryRateStrategyRequest(); + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: QueryRateStrategyRequestAmino): QueryRateStrategyRequest { + const message = createBaseQueryRateStrategyRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: QueryRateStrategyRequest, useInterfaces: boolean = false): QueryRateStrategyRequestAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + return obj; + }, + fromAminoMsg(object: QueryRateStrategyRequestAminoMsg): QueryRateStrategyRequest { + return QueryRateStrategyRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRateStrategyRequestProtoMsg, useInterfaces: boolean = false): QueryRateStrategyRequest { + return QueryRateStrategyRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRateStrategyRequest): Uint8Array { + return QueryRateStrategyRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRateStrategyRequest): QueryRateStrategyRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyRequest", + value: QueryRateStrategyRequest.encode(message).finish() + }; + } +}; +function createBaseQueryRateStrategyResponse(): QueryRateStrategyResponse { + return { + rateStrategyParams: undefined + }; +} +export const QueryRateStrategyResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyResponse", + encode(message: QueryRateStrategyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rateStrategyParams !== undefined) { + RateStrategyParams.encode(message.rateStrategyParams, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRateStrategyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRateStrategyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rateStrategyParams = RateStrategyParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRateStrategyResponse { + const message = createBaseQueryRateStrategyResponse(); + message.rateStrategyParams = object.rateStrategyParams !== undefined && object.rateStrategyParams !== null ? RateStrategyParams.fromPartial(object.rateStrategyParams) : undefined; + return message; + }, + fromAmino(object: QueryRateStrategyResponseAmino): QueryRateStrategyResponse { + const message = createBaseQueryRateStrategyResponse(); + if (object.rate_strategy_params !== undefined && object.rate_strategy_params !== null) { + message.rateStrategyParams = RateStrategyParams.fromAmino(object.rate_strategy_params); + } + return message; + }, + toAmino(message: QueryRateStrategyResponse, useInterfaces: boolean = false): QueryRateStrategyResponseAmino { + const obj: any = {}; + obj.rate_strategy_params = message.rateStrategyParams ? RateStrategyParams.toAmino(message.rateStrategyParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRateStrategyResponseAminoMsg): QueryRateStrategyResponse { + return QueryRateStrategyResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRateStrategyResponseProtoMsg, useInterfaces: boolean = false): QueryRateStrategyResponse { + return QueryRateStrategyResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRateStrategyResponse): Uint8Array { + return QueryRateStrategyResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRateStrategyResponse): QueryRateStrategyResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyResponse", + value: QueryRateStrategyResponse.encode(message).finish() + }; + } +}; +function createBaseQueryRateStrategyAllRequest(): QueryRateStrategyAllRequest { + return { + pagination: undefined + }; +} +export const QueryRateStrategyAllRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyAllRequest", + encode(message: QueryRateStrategyAllRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRateStrategyAllRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRateStrategyAllRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRateStrategyAllRequest { + const message = createBaseQueryRateStrategyAllRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRateStrategyAllRequestAmino): QueryRateStrategyAllRequest { + const message = createBaseQueryRateStrategyAllRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRateStrategyAllRequest, useInterfaces: boolean = false): QueryRateStrategyAllRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRateStrategyAllRequestAminoMsg): QueryRateStrategyAllRequest { + return QueryRateStrategyAllRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRateStrategyAllRequestProtoMsg, useInterfaces: boolean = false): QueryRateStrategyAllRequest { + return QueryRateStrategyAllRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRateStrategyAllRequest): Uint8Array { + return QueryRateStrategyAllRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRateStrategyAllRequest): QueryRateStrategyAllRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyAllRequest", + value: QueryRateStrategyAllRequest.encode(message).finish() + }; + } +}; +function createBaseQueryRateStrategyAllResponse(): QueryRateStrategyAllResponse { + return { + rateStrategyParamsAll: [], + pagination: undefined + }; +} +export const QueryRateStrategyAllResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyAllResponse", + encode(message: QueryRateStrategyAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rateStrategyParamsAll) { + RateStrategyParams.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRateStrategyAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRateStrategyAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rateStrategyParamsAll.push(RateStrategyParams.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRateStrategyAllResponse { + const message = createBaseQueryRateStrategyAllResponse(); + message.rateStrategyParamsAll = object.rateStrategyParamsAll?.map(e => RateStrategyParams.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRateStrategyAllResponseAmino): QueryRateStrategyAllResponse { + const message = createBaseQueryRateStrategyAllResponse(); + message.rateStrategyParamsAll = object.rate_strategy_params_all?.map(e => RateStrategyParams.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRateStrategyAllResponse, useInterfaces: boolean = false): QueryRateStrategyAllResponseAmino { + const obj: any = {}; + if (message.rateStrategyParamsAll) { + obj.rate_strategy_params_all = message.rateStrategyParamsAll.map(e => e ? RateStrategyParams.toAmino(e, useInterfaces) : undefined); + } else { + obj.rate_strategy_params_all = message.rateStrategyParamsAll; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRateStrategyAllResponseAminoMsg): QueryRateStrategyAllResponse { + return QueryRateStrategyAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRateStrategyAllResponseProtoMsg, useInterfaces: boolean = false): QueryRateStrategyAllResponse { + return QueryRateStrategyAllResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRateStrategyAllResponse): Uint8Array { + return QueryRateStrategyAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRateStrategyAllResponse): QueryRateStrategyAllResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryRateStrategyAllResponse", + value: QueryRateStrategyAllResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountDataRequest(): QueryAccountDataRequest { + return { + address: "" + }; +} +export const QueryAccountDataRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDataRequest", + encode(message: QueryAccountDataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountDataRequest { + const message = createBaseQueryAccountDataRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAccountDataRequestAmino): QueryAccountDataRequest { + const message = createBaseQueryAccountDataRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAccountDataRequest, useInterfaces: boolean = false): QueryAccountDataRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryAccountDataRequestAminoMsg): QueryAccountDataRequest { + return QueryAccountDataRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountDataRequestProtoMsg, useInterfaces: boolean = false): QueryAccountDataRequest { + return QueryAccountDataRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountDataRequest): Uint8Array { + return QueryAccountDataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountDataRequest): QueryAccountDataRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDataRequest", + value: QueryAccountDataRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountDataResponse(): QueryAccountDataResponse { + return { + totalCollateralsUsd: "", + totalDebtsUsd: "", + availableBorrowsUsd: "", + currLiquidationThreshold: "" + }; +} +export const QueryAccountDataResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDataResponse", + encode(message: QueryAccountDataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalCollateralsUsd !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.totalCollateralsUsd, 18).atomics); + } + if (message.totalDebtsUsd !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.totalDebtsUsd, 18).atomics); + } + if (message.availableBorrowsUsd !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.availableBorrowsUsd, 18).atomics); + } + if (message.currLiquidationThreshold !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.currLiquidationThreshold, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCollateralsUsd = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.totalDebtsUsd = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.availableBorrowsUsd = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.currLiquidationThreshold = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountDataResponse { + const message = createBaseQueryAccountDataResponse(); + message.totalCollateralsUsd = object.totalCollateralsUsd ?? ""; + message.totalDebtsUsd = object.totalDebtsUsd ?? ""; + message.availableBorrowsUsd = object.availableBorrowsUsd ?? ""; + message.currLiquidationThreshold = object.currLiquidationThreshold ?? ""; + return message; + }, + fromAmino(object: QueryAccountDataResponseAmino): QueryAccountDataResponse { + const message = createBaseQueryAccountDataResponse(); + if (object.total_collaterals_usd !== undefined && object.total_collaterals_usd !== null) { + message.totalCollateralsUsd = object.total_collaterals_usd; + } + if (object.total_debts_usd !== undefined && object.total_debts_usd !== null) { + message.totalDebtsUsd = object.total_debts_usd; + } + if (object.available_borrows_usd !== undefined && object.available_borrows_usd !== null) { + message.availableBorrowsUsd = object.available_borrows_usd; + } + if (object.curr_liquidation_threshold !== undefined && object.curr_liquidation_threshold !== null) { + message.currLiquidationThreshold = object.curr_liquidation_threshold; + } + return message; + }, + toAmino(message: QueryAccountDataResponse, useInterfaces: boolean = false): QueryAccountDataResponseAmino { + const obj: any = {}; + obj.total_collaterals_usd = message.totalCollateralsUsd === "" ? undefined : message.totalCollateralsUsd; + obj.total_debts_usd = message.totalDebtsUsd === "" ? undefined : message.totalDebtsUsd; + obj.available_borrows_usd = message.availableBorrowsUsd === "" ? undefined : message.availableBorrowsUsd; + obj.curr_liquidation_threshold = message.currLiquidationThreshold === "" ? undefined : message.currLiquidationThreshold; + return obj; + }, + fromAminoMsg(object: QueryAccountDataResponseAminoMsg): QueryAccountDataResponse { + return QueryAccountDataResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountDataResponseProtoMsg, useInterfaces: boolean = false): QueryAccountDataResponse { + return QueryAccountDataResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountDataResponse): Uint8Array { + return QueryAccountDataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountDataResponse): QueryAccountDataResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDataResponse", + value: QueryAccountDataResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountCollateralRequest(): QueryAccountCollateralRequest { + return { + address: "", + cibtDenom: "" + }; +} +export const QueryAccountCollateralRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralRequest", + encode(message: QueryAccountCollateralRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.cibtDenom !== "") { + writer.uint32(18).string(message.cibtDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountCollateralRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountCollateralRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.cibtDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountCollateralRequest { + const message = createBaseQueryAccountCollateralRequest(); + message.address = object.address ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + return message; + }, + fromAmino(object: QueryAccountCollateralRequestAmino): QueryAccountCollateralRequest { + const message = createBaseQueryAccountCollateralRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + return message; + }, + toAmino(message: QueryAccountCollateralRequest, useInterfaces: boolean = false): QueryAccountCollateralRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + return obj; + }, + fromAminoMsg(object: QueryAccountCollateralRequestAminoMsg): QueryAccountCollateralRequest { + return QueryAccountCollateralRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountCollateralRequestProtoMsg, useInterfaces: boolean = false): QueryAccountCollateralRequest { + return QueryAccountCollateralRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountCollateralRequest): Uint8Array { + return QueryAccountCollateralRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountCollateralRequest): QueryAccountCollateralRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralRequest", + value: QueryAccountCollateralRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountCollateralResponse(): QueryAccountCollateralResponse { + return { + collateral: undefined + }; +} +export const QueryAccountCollateralResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralResponse", + encode(message: QueryAccountCollateralResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.collateral !== undefined) { + Collateral.encode(message.collateral, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountCollateralResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountCollateralResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.collateral = Collateral.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountCollateralResponse { + const message = createBaseQueryAccountCollateralResponse(); + message.collateral = object.collateral !== undefined && object.collateral !== null ? Collateral.fromPartial(object.collateral) : undefined; + return message; + }, + fromAmino(object: QueryAccountCollateralResponseAmino): QueryAccountCollateralResponse { + const message = createBaseQueryAccountCollateralResponse(); + if (object.collateral !== undefined && object.collateral !== null) { + message.collateral = Collateral.fromAmino(object.collateral); + } + return message; + }, + toAmino(message: QueryAccountCollateralResponse, useInterfaces: boolean = false): QueryAccountCollateralResponseAmino { + const obj: any = {}; + obj.collateral = message.collateral ? Collateral.toAmino(message.collateral, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountCollateralResponseAminoMsg): QueryAccountCollateralResponse { + return QueryAccountCollateralResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountCollateralResponseProtoMsg, useInterfaces: boolean = false): QueryAccountCollateralResponse { + return QueryAccountCollateralResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountCollateralResponse): Uint8Array { + return QueryAccountCollateralResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountCollateralResponse): QueryAccountCollateralResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralResponse", + value: QueryAccountCollateralResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountCollateralAllRequest(): QueryAccountCollateralAllRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryAccountCollateralAllRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralAllRequest", + encode(message: QueryAccountCollateralAllRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountCollateralAllRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountCollateralAllRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountCollateralAllRequest { + const message = createBaseQueryAccountCollateralAllRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAccountCollateralAllRequestAmino): QueryAccountCollateralAllRequest { + const message = createBaseQueryAccountCollateralAllRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAccountCollateralAllRequest, useInterfaces: boolean = false): QueryAccountCollateralAllRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountCollateralAllRequestAminoMsg): QueryAccountCollateralAllRequest { + return QueryAccountCollateralAllRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountCollateralAllRequestProtoMsg, useInterfaces: boolean = false): QueryAccountCollateralAllRequest { + return QueryAccountCollateralAllRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountCollateralAllRequest): Uint8Array { + return QueryAccountCollateralAllRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountCollateralAllRequest): QueryAccountCollateralAllRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralAllRequest", + value: QueryAccountCollateralAllRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountCollateralAllResponse(): QueryAccountCollateralAllResponse { + return { + collaterals: [], + pagination: undefined + }; +} +export const QueryAccountCollateralAllResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralAllResponse", + encode(message: QueryAccountCollateralAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.collaterals) { + Collateral.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountCollateralAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountCollateralAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.collaterals.push(Collateral.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountCollateralAllResponse { + const message = createBaseQueryAccountCollateralAllResponse(); + message.collaterals = object.collaterals?.map(e => Collateral.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAccountCollateralAllResponseAmino): QueryAccountCollateralAllResponse { + const message = createBaseQueryAccountCollateralAllResponse(); + message.collaterals = object.collaterals?.map(e => Collateral.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAccountCollateralAllResponse, useInterfaces: boolean = false): QueryAccountCollateralAllResponseAmino { + const obj: any = {}; + if (message.collaterals) { + obj.collaterals = message.collaterals.map(e => e ? Collateral.toAmino(e, useInterfaces) : undefined); + } else { + obj.collaterals = message.collaterals; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountCollateralAllResponseAminoMsg): QueryAccountCollateralAllResponse { + return QueryAccountCollateralAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountCollateralAllResponseProtoMsg, useInterfaces: boolean = false): QueryAccountCollateralAllResponse { + return QueryAccountCollateralAllResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountCollateralAllResponse): Uint8Array { + return QueryAccountCollateralAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountCollateralAllResponse): QueryAccountCollateralAllResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountCollateralAllResponse", + value: QueryAccountCollateralAllResponse.encode(message).finish() + }; + } +}; +function createBaseCollateral(): Collateral { + return { + denom: "", + cibtDenom: "", + collateralAmount: "" + }; +} +export const Collateral = { + typeUrl: "/Switcheo.carbon.cdp.Collateral", + encode(message: Collateral, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.cibtDenom !== "") { + writer.uint32(18).string(message.cibtDenom); + } + if (message.collateralAmount !== "") { + writer.uint32(26).string(message.collateralAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Collateral { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCollateral(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.cibtDenom = reader.string(); + break; + case 3: + message.collateralAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Collateral { + const message = createBaseCollateral(); + message.denom = object.denom ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + message.collateralAmount = object.collateralAmount ?? ""; + return message; + }, + fromAmino(object: CollateralAmino): Collateral { + const message = createBaseCollateral(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + if (object.collateral_amount !== undefined && object.collateral_amount !== null) { + message.collateralAmount = object.collateral_amount; + } + return message; + }, + toAmino(message: Collateral, useInterfaces: boolean = false): CollateralAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + obj.collateral_amount = message.collateralAmount === "" ? undefined : message.collateralAmount; + return obj; + }, + fromAminoMsg(object: CollateralAminoMsg): Collateral { + return Collateral.fromAmino(object.value); + }, + fromProtoMsg(message: CollateralProtoMsg, useInterfaces: boolean = false): Collateral { + return Collateral.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Collateral): Uint8Array { + return Collateral.encode(message).finish(); + }, + toProtoMsg(message: Collateral): CollateralProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.Collateral", + value: Collateral.encode(message).finish() + }; + } +}; +function createBaseQueryAccountDebtRequest(): QueryAccountDebtRequest { + return { + address: "", + denom: "" + }; +} +export const QueryAccountDebtRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtRequest", + encode(message: QueryAccountDebtRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountDebtRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountDebtRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountDebtRequest { + const message = createBaseQueryAccountDebtRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryAccountDebtRequestAmino): QueryAccountDebtRequest { + const message = createBaseQueryAccountDebtRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryAccountDebtRequest, useInterfaces: boolean = false): QueryAccountDebtRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryAccountDebtRequestAminoMsg): QueryAccountDebtRequest { + return QueryAccountDebtRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountDebtRequestProtoMsg, useInterfaces: boolean = false): QueryAccountDebtRequest { + return QueryAccountDebtRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountDebtRequest): Uint8Array { + return QueryAccountDebtRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountDebtRequest): QueryAccountDebtRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtRequest", + value: QueryAccountDebtRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountDebtResponse(): QueryAccountDebtResponse { + return { + debt: undefined + }; +} +export const QueryAccountDebtResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtResponse", + encode(message: QueryAccountDebtResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.debt !== undefined) { + Debt.encode(message.debt, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountDebtResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountDebtResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.debt = Debt.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountDebtResponse { + const message = createBaseQueryAccountDebtResponse(); + message.debt = object.debt !== undefined && object.debt !== null ? Debt.fromPartial(object.debt) : undefined; + return message; + }, + fromAmino(object: QueryAccountDebtResponseAmino): QueryAccountDebtResponse { + const message = createBaseQueryAccountDebtResponse(); + if (object.debt !== undefined && object.debt !== null) { + message.debt = Debt.fromAmino(object.debt); + } + return message; + }, + toAmino(message: QueryAccountDebtResponse, useInterfaces: boolean = false): QueryAccountDebtResponseAmino { + const obj: any = {}; + obj.debt = message.debt ? Debt.toAmino(message.debt, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountDebtResponseAminoMsg): QueryAccountDebtResponse { + return QueryAccountDebtResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountDebtResponseProtoMsg, useInterfaces: boolean = false): QueryAccountDebtResponse { + return QueryAccountDebtResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountDebtResponse): Uint8Array { + return QueryAccountDebtResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountDebtResponse): QueryAccountDebtResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtResponse", + value: QueryAccountDebtResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountDebtAllRequest(): QueryAccountDebtAllRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryAccountDebtAllRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtAllRequest", + encode(message: QueryAccountDebtAllRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountDebtAllRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountDebtAllRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountDebtAllRequest { + const message = createBaseQueryAccountDebtAllRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAccountDebtAllRequestAmino): QueryAccountDebtAllRequest { + const message = createBaseQueryAccountDebtAllRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAccountDebtAllRequest, useInterfaces: boolean = false): QueryAccountDebtAllRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountDebtAllRequestAminoMsg): QueryAccountDebtAllRequest { + return QueryAccountDebtAllRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountDebtAllRequestProtoMsg, useInterfaces: boolean = false): QueryAccountDebtAllRequest { + return QueryAccountDebtAllRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountDebtAllRequest): Uint8Array { + return QueryAccountDebtAllRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountDebtAllRequest): QueryAccountDebtAllRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtAllRequest", + value: QueryAccountDebtAllRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountDebtAllResponse(): QueryAccountDebtAllResponse { + return { + debts: [], + pagination: undefined + }; +} +export const QueryAccountDebtAllResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtAllResponse", + encode(message: QueryAccountDebtAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.debts) { + Debt.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountDebtAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountDebtAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.debts.push(Debt.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountDebtAllResponse { + const message = createBaseQueryAccountDebtAllResponse(); + message.debts = object.debts?.map(e => Debt.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAccountDebtAllResponseAmino): QueryAccountDebtAllResponse { + const message = createBaseQueryAccountDebtAllResponse(); + message.debts = object.debts?.map(e => Debt.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAccountDebtAllResponse, useInterfaces: boolean = false): QueryAccountDebtAllResponseAmino { + const obj: any = {}; + if (message.debts) { + obj.debts = message.debts.map(e => e ? Debt.toAmino(e, useInterfaces) : undefined); + } else { + obj.debts = message.debts; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountDebtAllResponseAminoMsg): QueryAccountDebtAllResponse { + return QueryAccountDebtAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountDebtAllResponseProtoMsg, useInterfaces: boolean = false): QueryAccountDebtAllResponse { + return QueryAccountDebtAllResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountDebtAllResponse): Uint8Array { + return QueryAccountDebtAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountDebtAllResponse): QueryAccountDebtAllResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountDebtAllResponse", + value: QueryAccountDebtAllResponse.encode(message).finish() + }; + } +}; +function createBaseDebt(): Debt { + return { + denom: "", + principal: "", + initialCumulativeInterestMultiplier: "" + }; +} +export const Debt = { + typeUrl: "/Switcheo.carbon.cdp.Debt", + encode(message: Debt, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.principal !== "") { + writer.uint32(18).string(message.principal); + } + if (message.initialCumulativeInterestMultiplier !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.initialCumulativeInterestMultiplier, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Debt { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDebt(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.principal = reader.string(); + break; + case 3: + message.initialCumulativeInterestMultiplier = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Debt { + const message = createBaseDebt(); + message.denom = object.denom ?? ""; + message.principal = object.principal ?? ""; + message.initialCumulativeInterestMultiplier = object.initialCumulativeInterestMultiplier ?? ""; + return message; + }, + fromAmino(object: DebtAmino): Debt { + const message = createBaseDebt(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.principal !== undefined && object.principal !== null) { + message.principal = object.principal; + } + if (object.initial_cumulative_interest_multiplier !== undefined && object.initial_cumulative_interest_multiplier !== null) { + message.initialCumulativeInterestMultiplier = object.initial_cumulative_interest_multiplier; + } + return message; + }, + toAmino(message: Debt, useInterfaces: boolean = false): DebtAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.principal = message.principal === "" ? undefined : message.principal; + obj.initial_cumulative_interest_multiplier = message.initialCumulativeInterestMultiplier === "" ? undefined : message.initialCumulativeInterestMultiplier; + return obj; + }, + fromAminoMsg(object: DebtAminoMsg): Debt { + return Debt.fromAmino(object.value); + }, + fromProtoMsg(message: DebtProtoMsg, useInterfaces: boolean = false): Debt { + return Debt.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Debt): Uint8Array { + return Debt.encode(message).finish(); + }, + toProtoMsg(message: Debt): DebtProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.Debt", + value: Debt.encode(message).finish() + }; + } +}; +function createBaseQueryAccountStablecoinRequest(): QueryAccountStablecoinRequest { + return { + address: "" + }; +} +export const QueryAccountStablecoinRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountStablecoinRequest", + encode(message: QueryAccountStablecoinRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountStablecoinRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountStablecoinRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountStablecoinRequest { + const message = createBaseQueryAccountStablecoinRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAccountStablecoinRequestAmino): QueryAccountStablecoinRequest { + const message = createBaseQueryAccountStablecoinRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAccountStablecoinRequest, useInterfaces: boolean = false): QueryAccountStablecoinRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryAccountStablecoinRequestAminoMsg): QueryAccountStablecoinRequest { + return QueryAccountStablecoinRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountStablecoinRequestProtoMsg, useInterfaces: boolean = false): QueryAccountStablecoinRequest { + return QueryAccountStablecoinRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountStablecoinRequest): Uint8Array { + return QueryAccountStablecoinRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountStablecoinRequest): QueryAccountStablecoinRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountStablecoinRequest", + value: QueryAccountStablecoinRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountStablecoinResponse(): QueryAccountStablecoinResponse { + return { + principal: "", + interest: "", + initialCumulativeInterestMultiplier: "" + }; +} +export const QueryAccountStablecoinResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountStablecoinResponse", + encode(message: QueryAccountStablecoinResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.principal !== "") { + writer.uint32(10).string(message.principal); + } + if (message.interest !== "") { + writer.uint32(18).string(message.interest); + } + if (message.initialCumulativeInterestMultiplier !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.initialCumulativeInterestMultiplier, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountStablecoinResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountStablecoinResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.principal = reader.string(); + break; + case 2: + message.interest = reader.string(); + break; + case 3: + message.initialCumulativeInterestMultiplier = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountStablecoinResponse { + const message = createBaseQueryAccountStablecoinResponse(); + message.principal = object.principal ?? ""; + message.interest = object.interest ?? ""; + message.initialCumulativeInterestMultiplier = object.initialCumulativeInterestMultiplier ?? ""; + return message; + }, + fromAmino(object: QueryAccountStablecoinResponseAmino): QueryAccountStablecoinResponse { + const message = createBaseQueryAccountStablecoinResponse(); + if (object.principal !== undefined && object.principal !== null) { + message.principal = object.principal; + } + if (object.interest !== undefined && object.interest !== null) { + message.interest = object.interest; + } + if (object.initial_cumulative_interest_multiplier !== undefined && object.initial_cumulative_interest_multiplier !== null) { + message.initialCumulativeInterestMultiplier = object.initial_cumulative_interest_multiplier; + } + return message; + }, + toAmino(message: QueryAccountStablecoinResponse, useInterfaces: boolean = false): QueryAccountStablecoinResponseAmino { + const obj: any = {}; + obj.principal = message.principal === "" ? undefined : message.principal; + obj.interest = message.interest === "" ? undefined : message.interest; + obj.initial_cumulative_interest_multiplier = message.initialCumulativeInterestMultiplier === "" ? undefined : message.initialCumulativeInterestMultiplier; + return obj; + }, + fromAminoMsg(object: QueryAccountStablecoinResponseAminoMsg): QueryAccountStablecoinResponse { + return QueryAccountStablecoinResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountStablecoinResponseProtoMsg, useInterfaces: boolean = false): QueryAccountStablecoinResponse { + return QueryAccountStablecoinResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountStablecoinResponse): Uint8Array { + return QueryAccountStablecoinResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountStablecoinResponse): QueryAccountStablecoinResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountStablecoinResponse", + value: QueryAccountStablecoinResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAssetRequest(): QueryAssetRequest { + return { + denom: "" + }; +} +export const QueryAssetRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetRequest", + encode(message: QueryAssetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAssetRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAssetRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAssetRequest { + const message = createBaseQueryAssetRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryAssetRequestAmino): QueryAssetRequest { + const message = createBaseQueryAssetRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryAssetRequest, useInterfaces: boolean = false): QueryAssetRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryAssetRequestAminoMsg): QueryAssetRequest { + return QueryAssetRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAssetRequestProtoMsg, useInterfaces: boolean = false): QueryAssetRequest { + return QueryAssetRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAssetRequest): Uint8Array { + return QueryAssetRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAssetRequest): QueryAssetRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetRequest", + value: QueryAssetRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAssetResponse(): QueryAssetResponse { + return { + assetParams: undefined + }; +} +export const QueryAssetResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetResponse", + encode(message: QueryAssetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetParams !== undefined) { + AssetParamsAPI.encode(message.assetParams, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAssetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAssetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetParams = AssetParamsAPI.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAssetResponse { + const message = createBaseQueryAssetResponse(); + message.assetParams = object.assetParams !== undefined && object.assetParams !== null ? AssetParamsAPI.fromPartial(object.assetParams) : undefined; + return message; + }, + fromAmino(object: QueryAssetResponseAmino): QueryAssetResponse { + const message = createBaseQueryAssetResponse(); + if (object.asset_params !== undefined && object.asset_params !== null) { + message.assetParams = AssetParamsAPI.fromAmino(object.asset_params); + } + return message; + }, + toAmino(message: QueryAssetResponse, useInterfaces: boolean = false): QueryAssetResponseAmino { + const obj: any = {}; + obj.asset_params = message.assetParams ? AssetParamsAPI.toAmino(message.assetParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAssetResponseAminoMsg): QueryAssetResponse { + return QueryAssetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAssetResponseProtoMsg, useInterfaces: boolean = false): QueryAssetResponse { + return QueryAssetResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAssetResponse): Uint8Array { + return QueryAssetResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAssetResponse): QueryAssetResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetResponse", + value: QueryAssetResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAssetAllRequest(): QueryAssetAllRequest { + return { + pagination: undefined + }; +} +export const QueryAssetAllRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetAllRequest", + encode(message: QueryAssetAllRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAssetAllRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAssetAllRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAssetAllRequest { + const message = createBaseQueryAssetAllRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAssetAllRequestAmino): QueryAssetAllRequest { + const message = createBaseQueryAssetAllRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAssetAllRequest, useInterfaces: boolean = false): QueryAssetAllRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAssetAllRequestAminoMsg): QueryAssetAllRequest { + return QueryAssetAllRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAssetAllRequestProtoMsg, useInterfaces: boolean = false): QueryAssetAllRequest { + return QueryAssetAllRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAssetAllRequest): Uint8Array { + return QueryAssetAllRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAssetAllRequest): QueryAssetAllRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetAllRequest", + value: QueryAssetAllRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAssetAllResponse(): QueryAssetAllResponse { + return { + assetParamsAll: [], + pagination: undefined + }; +} +export const QueryAssetAllResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetAllResponse", + encode(message: QueryAssetAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.assetParamsAll) { + AssetParamsAPI.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAssetAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAssetAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetParamsAll.push(AssetParamsAPI.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAssetAllResponse { + const message = createBaseQueryAssetAllResponse(); + message.assetParamsAll = object.assetParamsAll?.map(e => AssetParamsAPI.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAssetAllResponseAmino): QueryAssetAllResponse { + const message = createBaseQueryAssetAllResponse(); + message.assetParamsAll = object.asset_params_all?.map(e => AssetParamsAPI.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAssetAllResponse, useInterfaces: boolean = false): QueryAssetAllResponseAmino { + const obj: any = {}; + if (message.assetParamsAll) { + obj.asset_params_all = message.assetParamsAll.map(e => e ? AssetParamsAPI.toAmino(e, useInterfaces) : undefined); + } else { + obj.asset_params_all = message.assetParamsAll; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAssetAllResponseAminoMsg): QueryAssetAllResponse { + return QueryAssetAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAssetAllResponseProtoMsg, useInterfaces: boolean = false): QueryAssetAllResponse { + return QueryAssetAllResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAssetAllResponse): Uint8Array { + return QueryAssetAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAssetAllResponse): QueryAssetAllResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAssetAllResponse", + value: QueryAssetAllResponse.encode(message).finish() + }; + } +}; +function createBaseQueryTokenDebtRequest(): QueryTokenDebtRequest { + return { + denom: "" + }; +} +export const QueryTokenDebtRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtRequest", + encode(message: QueryTokenDebtRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryTokenDebtRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTokenDebtRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTokenDebtRequest { + const message = createBaseQueryTokenDebtRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryTokenDebtRequestAmino): QueryTokenDebtRequest { + const message = createBaseQueryTokenDebtRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryTokenDebtRequest, useInterfaces: boolean = false): QueryTokenDebtRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryTokenDebtRequestAminoMsg): QueryTokenDebtRequest { + return QueryTokenDebtRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTokenDebtRequestProtoMsg, useInterfaces: boolean = false): QueryTokenDebtRequest { + return QueryTokenDebtRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryTokenDebtRequest): Uint8Array { + return QueryTokenDebtRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTokenDebtRequest): QueryTokenDebtRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtRequest", + value: QueryTokenDebtRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTokenDebtResponse(): QueryTokenDebtResponse { + return { + debtInfo: undefined + }; +} +export const QueryTokenDebtResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtResponse", + encode(message: QueryTokenDebtResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.debtInfo !== undefined) { + DebtInfo.encode(message.debtInfo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryTokenDebtResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTokenDebtResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.debtInfo = DebtInfo.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTokenDebtResponse { + const message = createBaseQueryTokenDebtResponse(); + message.debtInfo = object.debtInfo !== undefined && object.debtInfo !== null ? DebtInfo.fromPartial(object.debtInfo) : undefined; + return message; + }, + fromAmino(object: QueryTokenDebtResponseAmino): QueryTokenDebtResponse { + const message = createBaseQueryTokenDebtResponse(); + if (object.debt_info !== undefined && object.debt_info !== null) { + message.debtInfo = DebtInfo.fromAmino(object.debt_info); + } + return message; + }, + toAmino(message: QueryTokenDebtResponse, useInterfaces: boolean = false): QueryTokenDebtResponseAmino { + const obj: any = {}; + obj.debt_info = message.debtInfo ? DebtInfo.toAmino(message.debtInfo, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTokenDebtResponseAminoMsg): QueryTokenDebtResponse { + return QueryTokenDebtResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTokenDebtResponseProtoMsg, useInterfaces: boolean = false): QueryTokenDebtResponse { + return QueryTokenDebtResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryTokenDebtResponse): Uint8Array { + return QueryTokenDebtResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTokenDebtResponse): QueryTokenDebtResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtResponse", + value: QueryTokenDebtResponse.encode(message).finish() + }; + } +}; +function createBaseQueryTokenDebtAllRequest(): QueryTokenDebtAllRequest { + return { + pagination: undefined + }; +} +export const QueryTokenDebtAllRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtAllRequest", + encode(message: QueryTokenDebtAllRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryTokenDebtAllRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTokenDebtAllRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTokenDebtAllRequest { + const message = createBaseQueryTokenDebtAllRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryTokenDebtAllRequestAmino): QueryTokenDebtAllRequest { + const message = createBaseQueryTokenDebtAllRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryTokenDebtAllRequest, useInterfaces: boolean = false): QueryTokenDebtAllRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTokenDebtAllRequestAminoMsg): QueryTokenDebtAllRequest { + return QueryTokenDebtAllRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTokenDebtAllRequestProtoMsg, useInterfaces: boolean = false): QueryTokenDebtAllRequest { + return QueryTokenDebtAllRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryTokenDebtAllRequest): Uint8Array { + return QueryTokenDebtAllRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTokenDebtAllRequest): QueryTokenDebtAllRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtAllRequest", + value: QueryTokenDebtAllRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTokenDebtAllResponse(): QueryTokenDebtAllResponse { + return { + debtInfosAll: [], + pagination: undefined + }; +} +export const QueryTokenDebtAllResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtAllResponse", + encode(message: QueryTokenDebtAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.debtInfosAll) { + DebtInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryTokenDebtAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTokenDebtAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.debtInfosAll.push(DebtInfo.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTokenDebtAllResponse { + const message = createBaseQueryTokenDebtAllResponse(); + message.debtInfosAll = object.debtInfosAll?.map(e => DebtInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryTokenDebtAllResponseAmino): QueryTokenDebtAllResponse { + const message = createBaseQueryTokenDebtAllResponse(); + message.debtInfosAll = object.debt_infos_all?.map(e => DebtInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryTokenDebtAllResponse, useInterfaces: boolean = false): QueryTokenDebtAllResponseAmino { + const obj: any = {}; + if (message.debtInfosAll) { + obj.debt_infos_all = message.debtInfosAll.map(e => e ? DebtInfo.toAmino(e, useInterfaces) : undefined); + } else { + obj.debt_infos_all = message.debtInfosAll; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTokenDebtAllResponseAminoMsg): QueryTokenDebtAllResponse { + return QueryTokenDebtAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryTokenDebtAllResponseProtoMsg, useInterfaces: boolean = false): QueryTokenDebtAllResponse { + return QueryTokenDebtAllResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryTokenDebtAllResponse): Uint8Array { + return QueryTokenDebtAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTokenDebtAllResponse): QueryTokenDebtAllResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryTokenDebtAllResponse", + value: QueryTokenDebtAllResponse.encode(message).finish() + }; + } +}; +function createBaseQueryStablecoinDebtRequest(): QueryStablecoinDebtRequest { + return {}; +} +export const QueryStablecoinDebtRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinDebtRequest", + encode(_: QueryStablecoinDebtRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryStablecoinDebtRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStablecoinDebtRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryStablecoinDebtRequest { + const message = createBaseQueryStablecoinDebtRequest(); + return message; + }, + fromAmino(_: QueryStablecoinDebtRequestAmino): QueryStablecoinDebtRequest { + const message = createBaseQueryStablecoinDebtRequest(); + return message; + }, + toAmino(_: QueryStablecoinDebtRequest, useInterfaces: boolean = false): QueryStablecoinDebtRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryStablecoinDebtRequestAminoMsg): QueryStablecoinDebtRequest { + return QueryStablecoinDebtRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStablecoinDebtRequestProtoMsg, useInterfaces: boolean = false): QueryStablecoinDebtRequest { + return QueryStablecoinDebtRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryStablecoinDebtRequest): Uint8Array { + return QueryStablecoinDebtRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryStablecoinDebtRequest): QueryStablecoinDebtRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinDebtRequest", + value: QueryStablecoinDebtRequest.encode(message).finish() + }; + } +}; +function createBaseQueryStablecoinDebtResponse(): QueryStablecoinDebtResponse { + return { + stablecoinDebtInfo: undefined + }; +} +export const QueryStablecoinDebtResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinDebtResponse", + encode(message: QueryStablecoinDebtResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stablecoinDebtInfo !== undefined) { + StablecoinDebtInfo.encode(message.stablecoinDebtInfo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryStablecoinDebtResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStablecoinDebtResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stablecoinDebtInfo = StablecoinDebtInfo.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryStablecoinDebtResponse { + const message = createBaseQueryStablecoinDebtResponse(); + message.stablecoinDebtInfo = object.stablecoinDebtInfo !== undefined && object.stablecoinDebtInfo !== null ? StablecoinDebtInfo.fromPartial(object.stablecoinDebtInfo) : undefined; + return message; + }, + fromAmino(object: QueryStablecoinDebtResponseAmino): QueryStablecoinDebtResponse { + const message = createBaseQueryStablecoinDebtResponse(); + if (object.stablecoin_debt_info !== undefined && object.stablecoin_debt_info !== null) { + message.stablecoinDebtInfo = StablecoinDebtInfo.fromAmino(object.stablecoin_debt_info); + } + return message; + }, + toAmino(message: QueryStablecoinDebtResponse, useInterfaces: boolean = false): QueryStablecoinDebtResponseAmino { + const obj: any = {}; + obj.stablecoin_debt_info = message.stablecoinDebtInfo ? StablecoinDebtInfo.toAmino(message.stablecoinDebtInfo, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryStablecoinDebtResponseAminoMsg): QueryStablecoinDebtResponse { + return QueryStablecoinDebtResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStablecoinDebtResponseProtoMsg, useInterfaces: boolean = false): QueryStablecoinDebtResponse { + return QueryStablecoinDebtResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryStablecoinDebtResponse): Uint8Array { + return QueryStablecoinDebtResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryStablecoinDebtResponse): QueryStablecoinDebtResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinDebtResponse", + value: QueryStablecoinDebtResponse.encode(message).finish() + }; + } +}; +function createBaseCdpPositionItem(): CdpPositionItem { + return { + address: "", + denom: "", + cibtDenom: "", + healthFactor: "", + collateralAmount: "", + borrowAmount: "", + mintDenom: "", + mintAmount: "" + }; +} +export const CdpPositionItem = { + typeUrl: "/Switcheo.carbon.cdp.CdpPositionItem", + encode(message: CdpPositionItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.cibtDenom !== "") { + writer.uint32(26).string(message.cibtDenom); + } + if (message.healthFactor !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.healthFactor, 18).atomics); + } + if (message.collateralAmount !== "") { + writer.uint32(42).string(message.collateralAmount); + } + if (message.borrowAmount !== "") { + writer.uint32(50).string(message.borrowAmount); + } + if (message.mintDenom !== "") { + writer.uint32(58).string(message.mintDenom); + } + if (message.mintAmount !== "") { + writer.uint32(66).string(message.mintAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CdpPositionItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCdpPositionItem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.cibtDenom = reader.string(); + break; + case 4: + message.healthFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.collateralAmount = reader.string(); + break; + case 6: + message.borrowAmount = reader.string(); + break; + case 7: + message.mintDenom = reader.string(); + break; + case 8: + message.mintAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CdpPositionItem { + const message = createBaseCdpPositionItem(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + message.healthFactor = object.healthFactor ?? ""; + message.collateralAmount = object.collateralAmount ?? ""; + message.borrowAmount = object.borrowAmount ?? ""; + message.mintDenom = object.mintDenom ?? ""; + message.mintAmount = object.mintAmount ?? ""; + return message; + }, + fromAmino(object: CdpPositionItemAmino): CdpPositionItem { + const message = createBaseCdpPositionItem(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + if (object.health_factor !== undefined && object.health_factor !== null) { + message.healthFactor = object.health_factor; + } + if (object.collateral_amount !== undefined && object.collateral_amount !== null) { + message.collateralAmount = object.collateral_amount; + } + if (object.borrow_amount !== undefined && object.borrow_amount !== null) { + message.borrowAmount = object.borrow_amount; + } + if (object.mint_denom !== undefined && object.mint_denom !== null) { + message.mintDenom = object.mint_denom; + } + if (object.mint_amount !== undefined && object.mint_amount !== null) { + message.mintAmount = object.mint_amount; + } + return message; + }, + toAmino(message: CdpPositionItem, useInterfaces: boolean = false): CdpPositionItemAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + obj.health_factor = message.healthFactor === "" ? undefined : message.healthFactor; + obj.collateral_amount = message.collateralAmount === "" ? undefined : message.collateralAmount; + obj.borrow_amount = message.borrowAmount === "" ? undefined : message.borrowAmount; + obj.mint_denom = message.mintDenom === "" ? undefined : message.mintDenom; + obj.mint_amount = message.mintAmount === "" ? undefined : message.mintAmount; + return obj; + }, + fromAminoMsg(object: CdpPositionItemAminoMsg): CdpPositionItem { + return CdpPositionItem.fromAmino(object.value); + }, + fromProtoMsg(message: CdpPositionItemProtoMsg, useInterfaces: boolean = false): CdpPositionItem { + return CdpPositionItem.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CdpPositionItem): Uint8Array { + return CdpPositionItem.encode(message).finish(); + }, + toProtoMsg(message: CdpPositionItem): CdpPositionItemProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.CdpPositionItem", + value: CdpPositionItem.encode(message).finish() + }; + } +}; +function createBaseCdpPosition(): CdpPosition { + return { + address: "", + healthFactor: "", + collateral: [], + borrow: [], + mint: [] + }; +} +export const CdpPosition = { + typeUrl: "/Switcheo.carbon.cdp.CdpPosition", + encode(message: CdpPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.healthFactor !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.healthFactor, 18).atomics); + } + for (const v of message.collateral) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.borrow) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.mint) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CdpPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCdpPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.healthFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.collateral.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + case 4: + message.borrow.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + case 5: + message.mint.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CdpPosition { + const message = createBaseCdpPosition(); + message.address = object.address ?? ""; + message.healthFactor = object.healthFactor ?? ""; + message.collateral = object.collateral?.map(e => Coin.fromPartial(e)) || []; + message.borrow = object.borrow?.map(e => Coin.fromPartial(e)) || []; + message.mint = object.mint?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CdpPositionAmino): CdpPosition { + const message = createBaseCdpPosition(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.health_factor !== undefined && object.health_factor !== null) { + message.healthFactor = object.health_factor; + } + message.collateral = object.collateral?.map(e => Coin.fromAmino(e)) || []; + message.borrow = object.borrow?.map(e => Coin.fromAmino(e)) || []; + message.mint = object.mint?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: CdpPosition, useInterfaces: boolean = false): CdpPositionAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.health_factor = message.healthFactor === "" ? undefined : message.healthFactor; + if (message.collateral) { + obj.collateral = message.collateral.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.collateral = message.collateral; + } + if (message.borrow) { + obj.borrow = message.borrow.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.borrow = message.borrow; + } + if (message.mint) { + obj.mint = message.mint.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.mint = message.mint; + } + return obj; + }, + fromAminoMsg(object: CdpPositionAminoMsg): CdpPosition { + return CdpPosition.fromAmino(object.value); + }, + fromProtoMsg(message: CdpPositionProtoMsg, useInterfaces: boolean = false): CdpPosition { + return CdpPosition.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CdpPosition): Uint8Array { + return CdpPosition.encode(message).finish(); + }, + toProtoMsg(message: CdpPosition): CdpPositionProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.CdpPosition", + value: CdpPosition.encode(message).finish() + }; + } +}; +function createBaseQueryCdpPositionRequest(): QueryCdpPositionRequest { + return { + address: "" + }; +} +export const QueryCdpPositionRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionRequest", + encode(message: QueryCdpPositionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCdpPositionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCdpPositionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCdpPositionRequest { + const message = createBaseQueryCdpPositionRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryCdpPositionRequestAmino): QueryCdpPositionRequest { + const message = createBaseQueryCdpPositionRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryCdpPositionRequest, useInterfaces: boolean = false): QueryCdpPositionRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryCdpPositionRequestAminoMsg): QueryCdpPositionRequest { + return QueryCdpPositionRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCdpPositionRequestProtoMsg, useInterfaces: boolean = false): QueryCdpPositionRequest { + return QueryCdpPositionRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCdpPositionRequest): Uint8Array { + return QueryCdpPositionRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCdpPositionRequest): QueryCdpPositionRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionRequest", + value: QueryCdpPositionRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCdpPositionResponse(): QueryCdpPositionResponse { + return { + position: undefined + }; +} +export const QueryCdpPositionResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionResponse", + encode(message: QueryCdpPositionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.position !== undefined) { + CdpPosition.encode(message.position, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCdpPositionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCdpPositionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.position = CdpPosition.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCdpPositionResponse { + const message = createBaseQueryCdpPositionResponse(); + message.position = object.position !== undefined && object.position !== null ? CdpPosition.fromPartial(object.position) : undefined; + return message; + }, + fromAmino(object: QueryCdpPositionResponseAmino): QueryCdpPositionResponse { + const message = createBaseQueryCdpPositionResponse(); + if (object.position !== undefined && object.position !== null) { + message.position = CdpPosition.fromAmino(object.position); + } + return message; + }, + toAmino(message: QueryCdpPositionResponse, useInterfaces: boolean = false): QueryCdpPositionResponseAmino { + const obj: any = {}; + obj.position = message.position ? CdpPosition.toAmino(message.position, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCdpPositionResponseAminoMsg): QueryCdpPositionResponse { + return QueryCdpPositionResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCdpPositionResponseProtoMsg, useInterfaces: boolean = false): QueryCdpPositionResponse { + return QueryCdpPositionResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCdpPositionResponse): Uint8Array { + return QueryCdpPositionResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCdpPositionResponse): QueryCdpPositionResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionResponse", + value: QueryCdpPositionResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCdpPositionsRequest(): QueryCdpPositionsRequest { + return { + pagination: undefined, + maxHealthFactor: undefined, + minHealthFactor: undefined + }; +} +export const QueryCdpPositionsRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionsRequest", + encode(message: QueryCdpPositionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + if (message.maxHealthFactor !== undefined) { + writer.uint32(18).string(message.maxHealthFactor); + } + if (message.minHealthFactor !== undefined) { + writer.uint32(26).string(message.minHealthFactor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCdpPositionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCdpPositionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.maxHealthFactor = reader.string(); + break; + case 3: + message.minHealthFactor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCdpPositionsRequest { + const message = createBaseQueryCdpPositionsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + message.maxHealthFactor = object.maxHealthFactor ?? undefined; + message.minHealthFactor = object.minHealthFactor ?? undefined; + return message; + }, + fromAmino(object: QueryCdpPositionsRequestAmino): QueryCdpPositionsRequest { + const message = createBaseQueryCdpPositionsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.max_health_factor !== undefined && object.max_health_factor !== null) { + message.maxHealthFactor = object.max_health_factor; + } + if (object.min_health_factor !== undefined && object.min_health_factor !== null) { + message.minHealthFactor = object.min_health_factor; + } + return message; + }, + toAmino(message: QueryCdpPositionsRequest, useInterfaces: boolean = false): QueryCdpPositionsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + obj.max_health_factor = message.maxHealthFactor === null ? undefined : message.maxHealthFactor; + obj.min_health_factor = message.minHealthFactor === null ? undefined : message.minHealthFactor; + return obj; + }, + fromAminoMsg(object: QueryCdpPositionsRequestAminoMsg): QueryCdpPositionsRequest { + return QueryCdpPositionsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCdpPositionsRequestProtoMsg, useInterfaces: boolean = false): QueryCdpPositionsRequest { + return QueryCdpPositionsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCdpPositionsRequest): Uint8Array { + return QueryCdpPositionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCdpPositionsRequest): QueryCdpPositionsRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionsRequest", + value: QueryCdpPositionsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCdpPositionsResponse(): QueryCdpPositionsResponse { + return { + positions: [], + pagination: undefined + }; +} +export const QueryCdpPositionsResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionsResponse", + encode(message: QueryCdpPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.positions) { + CdpPosition.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCdpPositionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCdpPositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.positions.push(CdpPosition.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCdpPositionsResponse { + const message = createBaseQueryCdpPositionsResponse(); + message.positions = object.positions?.map(e => CdpPosition.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCdpPositionsResponseAmino): QueryCdpPositionsResponse { + const message = createBaseQueryCdpPositionsResponse(); + message.positions = object.positions?.map(e => CdpPosition.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCdpPositionsResponse, useInterfaces: boolean = false): QueryCdpPositionsResponseAmino { + const obj: any = {}; + if (message.positions) { + obj.positions = message.positions.map(e => e ? CdpPosition.toAmino(e, useInterfaces) : undefined); + } else { + obj.positions = message.positions; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCdpPositionsResponseAminoMsg): QueryCdpPositionsResponse { + return QueryCdpPositionsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCdpPositionsResponseProtoMsg, useInterfaces: boolean = false): QueryCdpPositionsResponse { + return QueryCdpPositionsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCdpPositionsResponse): Uint8Array { + return QueryCdpPositionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCdpPositionsResponse): QueryCdpPositionsResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryCdpPositionsResponse", + value: QueryCdpPositionsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryRewardSchemesAllRequest(): QueryRewardSchemesAllRequest { + return { + pagination: undefined + }; +} +export const QueryRewardSchemesAllRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardSchemesAllRequest", + encode(message: QueryRewardSchemesAllRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRewardSchemesAllRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRewardSchemesAllRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRewardSchemesAllRequest { + const message = createBaseQueryRewardSchemesAllRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRewardSchemesAllRequestAmino): QueryRewardSchemesAllRequest { + const message = createBaseQueryRewardSchemesAllRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRewardSchemesAllRequest, useInterfaces: boolean = false): QueryRewardSchemesAllRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRewardSchemesAllRequestAminoMsg): QueryRewardSchemesAllRequest { + return QueryRewardSchemesAllRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRewardSchemesAllRequestProtoMsg, useInterfaces: boolean = false): QueryRewardSchemesAllRequest { + return QueryRewardSchemesAllRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRewardSchemesAllRequest): Uint8Array { + return QueryRewardSchemesAllRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRewardSchemesAllRequest): QueryRewardSchemesAllRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardSchemesAllRequest", + value: QueryRewardSchemesAllRequest.encode(message).finish() + }; + } +}; +function createBaseQueryRewardSchemesAllResponse(): QueryRewardSchemesAllResponse { + return { + rewardSchemes: [], + pagination: undefined + }; +} +export const QueryRewardSchemesAllResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardSchemesAllResponse", + encode(message: QueryRewardSchemesAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rewardSchemes) { + RewardScheme.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRewardSchemesAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRewardSchemesAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardSchemes.push(RewardScheme.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRewardSchemesAllResponse { + const message = createBaseQueryRewardSchemesAllResponse(); + message.rewardSchemes = object.rewardSchemes?.map(e => RewardScheme.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRewardSchemesAllResponseAmino): QueryRewardSchemesAllResponse { + const message = createBaseQueryRewardSchemesAllResponse(); + message.rewardSchemes = object.reward_schemes?.map(e => RewardScheme.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRewardSchemesAllResponse, useInterfaces: boolean = false): QueryRewardSchemesAllResponseAmino { + const obj: any = {}; + if (message.rewardSchemes) { + obj.reward_schemes = message.rewardSchemes.map(e => e ? RewardScheme.toAmino(e, useInterfaces) : undefined); + } else { + obj.reward_schemes = message.rewardSchemes; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRewardSchemesAllResponseAminoMsg): QueryRewardSchemesAllResponse { + return QueryRewardSchemesAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRewardSchemesAllResponseProtoMsg, useInterfaces: boolean = false): QueryRewardSchemesAllResponse { + return QueryRewardSchemesAllResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRewardSchemesAllResponse): Uint8Array { + return QueryRewardSchemesAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRewardSchemesAllResponse): QueryRewardSchemesAllResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardSchemesAllResponse", + value: QueryRewardSchemesAllResponse.encode(message).finish() + }; + } +}; +function createBaseQueryRewardDebtsRequest(): QueryRewardDebtsRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryRewardDebtsRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardDebtsRequest", + encode(message: QueryRewardDebtsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRewardDebtsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRewardDebtsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRewardDebtsRequest { + const message = createBaseQueryRewardDebtsRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRewardDebtsRequestAmino): QueryRewardDebtsRequest { + const message = createBaseQueryRewardDebtsRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRewardDebtsRequest, useInterfaces: boolean = false): QueryRewardDebtsRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRewardDebtsRequestAminoMsg): QueryRewardDebtsRequest { + return QueryRewardDebtsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRewardDebtsRequestProtoMsg, useInterfaces: boolean = false): QueryRewardDebtsRequest { + return QueryRewardDebtsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRewardDebtsRequest): Uint8Array { + return QueryRewardDebtsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRewardDebtsRequest): QueryRewardDebtsRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardDebtsRequest", + value: QueryRewardDebtsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryRewardDebtsResponse(): QueryRewardDebtsResponse { + return { + rewardDebts: [], + pagination: undefined + }; +} +export const QueryRewardDebtsResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardDebtsResponse", + encode(message: QueryRewardDebtsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.rewardDebts) { + RewardDebt.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRewardDebtsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRewardDebtsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardDebts.push(RewardDebt.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRewardDebtsResponse { + const message = createBaseQueryRewardDebtsResponse(); + message.rewardDebts = object.rewardDebts?.map(e => RewardDebt.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRewardDebtsResponseAmino): QueryRewardDebtsResponse { + const message = createBaseQueryRewardDebtsResponse(); + message.rewardDebts = object.reward_debts?.map(e => RewardDebt.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRewardDebtsResponse, useInterfaces: boolean = false): QueryRewardDebtsResponseAmino { + const obj: any = {}; + if (message.rewardDebts) { + obj.reward_debts = message.rewardDebts.map(e => e ? RewardDebt.toAmino(e, useInterfaces) : undefined); + } else { + obj.reward_debts = message.rewardDebts; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRewardDebtsResponseAminoMsg): QueryRewardDebtsResponse { + return QueryRewardDebtsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRewardDebtsResponseProtoMsg, useInterfaces: boolean = false): QueryRewardDebtsResponse { + return QueryRewardDebtsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRewardDebtsResponse): Uint8Array { + return QueryRewardDebtsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRewardDebtsResponse): QueryRewardDebtsResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardDebtsResponse", + value: QueryRewardDebtsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryRewardDebtsAllRequest(): QueryRewardDebtsAllRequest { + return { + pagination: undefined + }; +} +export const QueryRewardDebtsAllRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardDebtsAllRequest", + encode(message: QueryRewardDebtsAllRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRewardDebtsAllRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRewardDebtsAllRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRewardDebtsAllRequest { + const message = createBaseQueryRewardDebtsAllRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryRewardDebtsAllRequestAmino): QueryRewardDebtsAllRequest { + const message = createBaseQueryRewardDebtsAllRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryRewardDebtsAllRequest, useInterfaces: boolean = false): QueryRewardDebtsAllRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRewardDebtsAllRequestAminoMsg): QueryRewardDebtsAllRequest { + return QueryRewardDebtsAllRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRewardDebtsAllRequestProtoMsg, useInterfaces: boolean = false): QueryRewardDebtsAllRequest { + return QueryRewardDebtsAllRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRewardDebtsAllRequest): Uint8Array { + return QueryRewardDebtsAllRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRewardDebtsAllRequest): QueryRewardDebtsAllRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryRewardDebtsAllRequest", + value: QueryRewardDebtsAllRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEModeAllRequest(): QueryEModeAllRequest { + return { + pagination: undefined + }; +} +export const QueryEModeAllRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeAllRequest", + encode(message: QueryEModeAllRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryEModeAllRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEModeAllRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEModeAllRequest { + const message = createBaseQueryEModeAllRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryEModeAllRequestAmino): QueryEModeAllRequest { + const message = createBaseQueryEModeAllRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryEModeAllRequest, useInterfaces: boolean = false): QueryEModeAllRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryEModeAllRequestAminoMsg): QueryEModeAllRequest { + return QueryEModeAllRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEModeAllRequestProtoMsg, useInterfaces: boolean = false): QueryEModeAllRequest { + return QueryEModeAllRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryEModeAllRequest): Uint8Array { + return QueryEModeAllRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEModeAllRequest): QueryEModeAllRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeAllRequest", + value: QueryEModeAllRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEModeAllResponse(): QueryEModeAllResponse { + return { + eModeCategories: [], + pagination: undefined + }; +} +export const QueryEModeAllResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeAllResponse", + encode(message: QueryEModeAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.eModeCategories) { + EModeCategory.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryEModeAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEModeAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eModeCategories.push(EModeCategory.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEModeAllResponse { + const message = createBaseQueryEModeAllResponse(); + message.eModeCategories = object.eModeCategories?.map(e => EModeCategory.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryEModeAllResponseAmino): QueryEModeAllResponse { + const message = createBaseQueryEModeAllResponse(); + message.eModeCategories = object.e_mode_categories?.map(e => EModeCategory.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryEModeAllResponse, useInterfaces: boolean = false): QueryEModeAllResponseAmino { + const obj: any = {}; + if (message.eModeCategories) { + obj.e_mode_categories = message.eModeCategories.map(e => e ? EModeCategory.toAmino(e, useInterfaces) : undefined); + } else { + obj.e_mode_categories = message.eModeCategories; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryEModeAllResponseAminoMsg): QueryEModeAllResponse { + return QueryEModeAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEModeAllResponseProtoMsg, useInterfaces: boolean = false): QueryEModeAllResponse { + return QueryEModeAllResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryEModeAllResponse): Uint8Array { + return QueryEModeAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEModeAllResponse): QueryEModeAllResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeAllResponse", + value: QueryEModeAllResponse.encode(message).finish() + }; + } +}; +function createBaseQueryStablecoinInterestRequest(): QueryStablecoinInterestRequest { + return {}; +} +export const QueryStablecoinInterestRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinInterestRequest", + encode(_: QueryStablecoinInterestRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryStablecoinInterestRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStablecoinInterestRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryStablecoinInterestRequest { + const message = createBaseQueryStablecoinInterestRequest(); + return message; + }, + fromAmino(_: QueryStablecoinInterestRequestAmino): QueryStablecoinInterestRequest { + const message = createBaseQueryStablecoinInterestRequest(); + return message; + }, + toAmino(_: QueryStablecoinInterestRequest, useInterfaces: boolean = false): QueryStablecoinInterestRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryStablecoinInterestRequestAminoMsg): QueryStablecoinInterestRequest { + return QueryStablecoinInterestRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStablecoinInterestRequestProtoMsg, useInterfaces: boolean = false): QueryStablecoinInterestRequest { + return QueryStablecoinInterestRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryStablecoinInterestRequest): Uint8Array { + return QueryStablecoinInterestRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryStablecoinInterestRequest): QueryStablecoinInterestRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinInterestRequest", + value: QueryStablecoinInterestRequest.encode(message).finish() + }; + } +}; +function createBaseQueryStablecoinInterestResponse(): QueryStablecoinInterestResponse { + return { + stablecoinInterestInfo: undefined + }; +} +export const QueryStablecoinInterestResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinInterestResponse", + encode(message: QueryStablecoinInterestResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stablecoinInterestInfo !== undefined) { + StablecoinInterestInfo.encode(message.stablecoinInterestInfo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryStablecoinInterestResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStablecoinInterestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stablecoinInterestInfo = StablecoinInterestInfo.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryStablecoinInterestResponse { + const message = createBaseQueryStablecoinInterestResponse(); + message.stablecoinInterestInfo = object.stablecoinInterestInfo !== undefined && object.stablecoinInterestInfo !== null ? StablecoinInterestInfo.fromPartial(object.stablecoinInterestInfo) : undefined; + return message; + }, + fromAmino(object: QueryStablecoinInterestResponseAmino): QueryStablecoinInterestResponse { + const message = createBaseQueryStablecoinInterestResponse(); + if (object.stablecoin_interest_info !== undefined && object.stablecoin_interest_info !== null) { + message.stablecoinInterestInfo = StablecoinInterestInfo.fromAmino(object.stablecoin_interest_info); + } + return message; + }, + toAmino(message: QueryStablecoinInterestResponse, useInterfaces: boolean = false): QueryStablecoinInterestResponseAmino { + const obj: any = {}; + obj.stablecoin_interest_info = message.stablecoinInterestInfo ? StablecoinInterestInfo.toAmino(message.stablecoinInterestInfo, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryStablecoinInterestResponseAminoMsg): QueryStablecoinInterestResponse { + return QueryStablecoinInterestResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStablecoinInterestResponseProtoMsg, useInterfaces: boolean = false): QueryStablecoinInterestResponse { + return QueryStablecoinInterestResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryStablecoinInterestResponse): Uint8Array { + return QueryStablecoinInterestResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryStablecoinInterestResponse): QueryStablecoinInterestResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryStablecoinInterestResponse", + value: QueryStablecoinInterestResponse.encode(message).finish() + }; + } +}; +function createBaseQueryEModeRequest(): QueryEModeRequest { + return { + name: "" + }; +} +export const QueryEModeRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeRequest", + encode(message: QueryEModeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryEModeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEModeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEModeRequest { + const message = createBaseQueryEModeRequest(); + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: QueryEModeRequestAmino): QueryEModeRequest { + const message = createBaseQueryEModeRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: QueryEModeRequest, useInterfaces: boolean = false): QueryEModeRequestAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + return obj; + }, + fromAminoMsg(object: QueryEModeRequestAminoMsg): QueryEModeRequest { + return QueryEModeRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEModeRequestProtoMsg, useInterfaces: boolean = false): QueryEModeRequest { + return QueryEModeRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryEModeRequest): Uint8Array { + return QueryEModeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEModeRequest): QueryEModeRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeRequest", + value: QueryEModeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEModeResponse(): QueryEModeResponse { + return { + eModeCategory: EModeCategory.fromPartial({}) + }; +} +export const QueryEModeResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeResponse", + encode(message: QueryEModeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eModeCategory !== undefined) { + EModeCategory.encode(message.eModeCategory, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryEModeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEModeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eModeCategory = EModeCategory.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEModeResponse { + const message = createBaseQueryEModeResponse(); + message.eModeCategory = object.eModeCategory !== undefined && object.eModeCategory !== null ? EModeCategory.fromPartial(object.eModeCategory) : undefined; + return message; + }, + fromAmino(object: QueryEModeResponseAmino): QueryEModeResponse { + const message = createBaseQueryEModeResponse(); + if (object.e_mode_category !== undefined && object.e_mode_category !== null) { + message.eModeCategory = EModeCategory.fromAmino(object.e_mode_category); + } + return message; + }, + toAmino(message: QueryEModeResponse, useInterfaces: boolean = false): QueryEModeResponseAmino { + const obj: any = {}; + obj.e_mode_category = message.eModeCategory ? EModeCategory.toAmino(message.eModeCategory, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryEModeResponseAminoMsg): QueryEModeResponse { + return QueryEModeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEModeResponseProtoMsg, useInterfaces: boolean = false): QueryEModeResponse { + return QueryEModeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryEModeResponse): Uint8Array { + return QueryEModeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEModeResponse): QueryEModeResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryEModeResponse", + value: QueryEModeResponse.encode(message).finish() + }; + } +}; +function createBaseQueryHealthFactorRequest(): QueryHealthFactorRequest { + return { + address: "" + }; +} +export const QueryHealthFactorRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryHealthFactorRequest", + encode(message: QueryHealthFactorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHealthFactorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHealthFactorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHealthFactorRequest { + const message = createBaseQueryHealthFactorRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryHealthFactorRequestAmino): QueryHealthFactorRequest { + const message = createBaseQueryHealthFactorRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryHealthFactorRequest, useInterfaces: boolean = false): QueryHealthFactorRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryHealthFactorRequestAminoMsg): QueryHealthFactorRequest { + return QueryHealthFactorRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHealthFactorRequestProtoMsg, useInterfaces: boolean = false): QueryHealthFactorRequest { + return QueryHealthFactorRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHealthFactorRequest): Uint8Array { + return QueryHealthFactorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHealthFactorRequest): QueryHealthFactorRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryHealthFactorRequest", + value: QueryHealthFactorRequest.encode(message).finish() + }; + } +}; +function createBaseQueryHealthFactorResponse(): QueryHealthFactorResponse { + return { + healthFactor: "" + }; +} +export const QueryHealthFactorResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryHealthFactorResponse", + encode(message: QueryHealthFactorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.healthFactor !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.healthFactor, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHealthFactorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHealthFactorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.healthFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHealthFactorResponse { + const message = createBaseQueryHealthFactorResponse(); + message.healthFactor = object.healthFactor ?? ""; + return message; + }, + fromAmino(object: QueryHealthFactorResponseAmino): QueryHealthFactorResponse { + const message = createBaseQueryHealthFactorResponse(); + if (object.health_factor !== undefined && object.health_factor !== null) { + message.healthFactor = object.health_factor; + } + return message; + }, + toAmino(message: QueryHealthFactorResponse, useInterfaces: boolean = false): QueryHealthFactorResponseAmino { + const obj: any = {}; + obj.health_factor = message.healthFactor === "" ? undefined : message.healthFactor; + return obj; + }, + fromAminoMsg(object: QueryHealthFactorResponseAminoMsg): QueryHealthFactorResponse { + return QueryHealthFactorResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHealthFactorResponseProtoMsg, useInterfaces: boolean = false): QueryHealthFactorResponse { + return QueryHealthFactorResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHealthFactorResponse): Uint8Array { + return QueryHealthFactorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHealthFactorResponse): QueryHealthFactorResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryHealthFactorResponse", + value: QueryHealthFactorResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountEModeRequest(): QueryAccountEModeRequest { + return { + address: "" + }; +} +export const QueryAccountEModeRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountEModeRequest", + encode(message: QueryAccountEModeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountEModeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountEModeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountEModeRequest { + const message = createBaseQueryAccountEModeRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAccountEModeRequestAmino): QueryAccountEModeRequest { + const message = createBaseQueryAccountEModeRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAccountEModeRequest, useInterfaces: boolean = false): QueryAccountEModeRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryAccountEModeRequestAminoMsg): QueryAccountEModeRequest { + return QueryAccountEModeRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountEModeRequestProtoMsg, useInterfaces: boolean = false): QueryAccountEModeRequest { + return QueryAccountEModeRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountEModeRequest): Uint8Array { + return QueryAccountEModeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountEModeRequest): QueryAccountEModeRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountEModeRequest", + value: QueryAccountEModeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountEModeResponse(): QueryAccountEModeResponse { + return { + eModeCategoryName: "" + }; +} +export const QueryAccountEModeResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountEModeResponse", + encode(message: QueryAccountEModeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.eModeCategoryName !== "") { + writer.uint32(10).string(message.eModeCategoryName); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAccountEModeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountEModeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eModeCategoryName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountEModeResponse { + const message = createBaseQueryAccountEModeResponse(); + message.eModeCategoryName = object.eModeCategoryName ?? ""; + return message; + }, + fromAmino(object: QueryAccountEModeResponseAmino): QueryAccountEModeResponse { + const message = createBaseQueryAccountEModeResponse(); + if (object.e_mode_category_name !== undefined && object.e_mode_category_name !== null) { + message.eModeCategoryName = object.e_mode_category_name; + } + return message; + }, + toAmino(message: QueryAccountEModeResponse, useInterfaces: boolean = false): QueryAccountEModeResponseAmino { + const obj: any = {}; + obj.e_mode_category_name = message.eModeCategoryName === "" ? undefined : message.eModeCategoryName; + return obj; + }, + fromAminoMsg(object: QueryAccountEModeResponseAminoMsg): QueryAccountEModeResponse { + return QueryAccountEModeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAccountEModeResponseProtoMsg, useInterfaces: boolean = false): QueryAccountEModeResponse { + return QueryAccountEModeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAccountEModeResponse): Uint8Array { + return QueryAccountEModeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountEModeResponse): QueryAccountEModeResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryAccountEModeResponse", + value: QueryAccountEModeResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCDPLiquidationsAllRequest(): QueryCDPLiquidationsAllRequest { + return { + pagination: undefined + }; +} +export const QueryCDPLiquidationsAllRequest = { + typeUrl: "/Switcheo.carbon.cdp.QueryCDPLiquidationsAllRequest", + encode(message: QueryCDPLiquidationsAllRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCDPLiquidationsAllRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCDPLiquidationsAllRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCDPLiquidationsAllRequest { + const message = createBaseQueryCDPLiquidationsAllRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCDPLiquidationsAllRequestAmino): QueryCDPLiquidationsAllRequest { + const message = createBaseQueryCDPLiquidationsAllRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCDPLiquidationsAllRequest, useInterfaces: boolean = false): QueryCDPLiquidationsAllRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCDPLiquidationsAllRequestAminoMsg): QueryCDPLiquidationsAllRequest { + return QueryCDPLiquidationsAllRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCDPLiquidationsAllRequestProtoMsg, useInterfaces: boolean = false): QueryCDPLiquidationsAllRequest { + return QueryCDPLiquidationsAllRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCDPLiquidationsAllRequest): Uint8Array { + return QueryCDPLiquidationsAllRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCDPLiquidationsAllRequest): QueryCDPLiquidationsAllRequestProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryCDPLiquidationsAllRequest", + value: QueryCDPLiquidationsAllRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCDPLiquidationsAllResponse(): QueryCDPLiquidationsAllResponse { + return { + cdpLiquidationsAll: [], + pagination: undefined + }; +} +export const QueryCDPLiquidationsAllResponse = { + typeUrl: "/Switcheo.carbon.cdp.QueryCDPLiquidationsAllResponse", + encode(message: QueryCDPLiquidationsAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.cdpLiquidationsAll) { + CDPLiquidations.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCDPLiquidationsAllResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCDPLiquidationsAllResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cdpLiquidationsAll.push(CDPLiquidations.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCDPLiquidationsAllResponse { + const message = createBaseQueryCDPLiquidationsAllResponse(); + message.cdpLiquidationsAll = object.cdpLiquidationsAll?.map(e => CDPLiquidations.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCDPLiquidationsAllResponseAmino): QueryCDPLiquidationsAllResponse { + const message = createBaseQueryCDPLiquidationsAllResponse(); + message.cdpLiquidationsAll = object.cdp_liquidations_all?.map(e => CDPLiquidations.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCDPLiquidationsAllResponse, useInterfaces: boolean = false): QueryCDPLiquidationsAllResponseAmino { + const obj: any = {}; + if (message.cdpLiquidationsAll) { + obj.cdp_liquidations_all = message.cdpLiquidationsAll.map(e => e ? CDPLiquidations.toAmino(e, useInterfaces) : undefined); + } else { + obj.cdp_liquidations_all = message.cdpLiquidationsAll; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCDPLiquidationsAllResponseAminoMsg): QueryCDPLiquidationsAllResponse { + return QueryCDPLiquidationsAllResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCDPLiquidationsAllResponseProtoMsg, useInterfaces: boolean = false): QueryCDPLiquidationsAllResponse { + return QueryCDPLiquidationsAllResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCDPLiquidationsAllResponse): Uint8Array { + return QueryCDPLiquidationsAllResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCDPLiquidationsAllResponse): QueryCDPLiquidationsAllResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.QueryCDPLiquidationsAllResponse", + value: QueryCDPLiquidationsAllResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/rate_strategy_params.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/rate_strategy_params.ts new file mode 100644 index 000000000..08ee282d0 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/rate_strategy_params.ts @@ -0,0 +1,201 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface RateStrategyParams { + name: string; + optimalUsage?: string; + baseVariableBorrowRate?: string; + variableRateSlope1?: string; + variableRateSlope2?: string; + baseStableBorrowRate?: string; + stableRateSlope1?: string; + stableRateSlope2?: string; + optimalStableToTotalDebtRatio?: string; +} +export interface RateStrategyParamsProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.RateStrategyParams"; + value: Uint8Array; +} +export interface RateStrategyParamsAmino { + name?: string; + optimal_usage?: string; + base_variable_borrow_rate?: string; + variable_rate_slope_1?: string; + variable_rate_slope_2?: string; + base_stable_borrow_rate?: string; + stable_rate_slope_1?: string; + stable_rate_slope_2?: string; + optimal_stable_to_total_debt_ratio?: string; +} +export interface RateStrategyParamsAminoMsg { + type: "/Switcheo.carbon.cdp.RateStrategyParams"; + value: RateStrategyParamsAmino; +} +export interface RateStrategyParamsSDKType { + name: string; + optimal_usage?: string; + base_variable_borrow_rate?: string; + variable_rate_slope_1?: string; + variable_rate_slope_2?: string; + base_stable_borrow_rate?: string; + stable_rate_slope_1?: string; + stable_rate_slope_2?: string; + optimal_stable_to_total_debt_ratio?: string; +} +function createBaseRateStrategyParams(): RateStrategyParams { + return { + name: "", + optimalUsage: undefined, + baseVariableBorrowRate: undefined, + variableRateSlope1: undefined, + variableRateSlope2: undefined, + baseStableBorrowRate: undefined, + stableRateSlope1: undefined, + stableRateSlope2: undefined, + optimalStableToTotalDebtRatio: undefined + }; +} +export const RateStrategyParams = { + typeUrl: "/Switcheo.carbon.cdp.RateStrategyParams", + encode(message: RateStrategyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.optimalUsage !== undefined) { + writer.uint32(18).string(message.optimalUsage); + } + if (message.baseVariableBorrowRate !== undefined) { + writer.uint32(26).string(message.baseVariableBorrowRate); + } + if (message.variableRateSlope1 !== undefined) { + writer.uint32(34).string(message.variableRateSlope1); + } + if (message.variableRateSlope2 !== undefined) { + writer.uint32(42).string(message.variableRateSlope2); + } + if (message.baseStableBorrowRate !== undefined) { + writer.uint32(50).string(message.baseStableBorrowRate); + } + if (message.stableRateSlope1 !== undefined) { + writer.uint32(58).string(message.stableRateSlope1); + } + if (message.stableRateSlope2 !== undefined) { + writer.uint32(66).string(message.stableRateSlope2); + } + if (message.optimalStableToTotalDebtRatio !== undefined) { + writer.uint32(74).string(message.optimalStableToTotalDebtRatio); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RateStrategyParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRateStrategyParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.optimalUsage = reader.string(); + break; + case 3: + message.baseVariableBorrowRate = reader.string(); + break; + case 4: + message.variableRateSlope1 = reader.string(); + break; + case 5: + message.variableRateSlope2 = reader.string(); + break; + case 6: + message.baseStableBorrowRate = reader.string(); + break; + case 7: + message.stableRateSlope1 = reader.string(); + break; + case 8: + message.stableRateSlope2 = reader.string(); + break; + case 9: + message.optimalStableToTotalDebtRatio = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RateStrategyParams { + const message = createBaseRateStrategyParams(); + message.name = object.name ?? ""; + message.optimalUsage = object.optimalUsage ?? undefined; + message.baseVariableBorrowRate = object.baseVariableBorrowRate ?? undefined; + message.variableRateSlope1 = object.variableRateSlope1 ?? undefined; + message.variableRateSlope2 = object.variableRateSlope2 ?? undefined; + message.baseStableBorrowRate = object.baseStableBorrowRate ?? undefined; + message.stableRateSlope1 = object.stableRateSlope1 ?? undefined; + message.stableRateSlope2 = object.stableRateSlope2 ?? undefined; + message.optimalStableToTotalDebtRatio = object.optimalStableToTotalDebtRatio ?? undefined; + return message; + }, + fromAmino(object: RateStrategyParamsAmino): RateStrategyParams { + const message = createBaseRateStrategyParams(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.optimal_usage !== undefined && object.optimal_usage !== null) { + message.optimalUsage = object.optimal_usage; + } + if (object.base_variable_borrow_rate !== undefined && object.base_variable_borrow_rate !== null) { + message.baseVariableBorrowRate = object.base_variable_borrow_rate; + } + if (object.variable_rate_slope_1 !== undefined && object.variable_rate_slope_1 !== null) { + message.variableRateSlope1 = object.variable_rate_slope_1; + } + if (object.variable_rate_slope_2 !== undefined && object.variable_rate_slope_2 !== null) { + message.variableRateSlope2 = object.variable_rate_slope_2; + } + if (object.base_stable_borrow_rate !== undefined && object.base_stable_borrow_rate !== null) { + message.baseStableBorrowRate = object.base_stable_borrow_rate; + } + if (object.stable_rate_slope_1 !== undefined && object.stable_rate_slope_1 !== null) { + message.stableRateSlope1 = object.stable_rate_slope_1; + } + if (object.stable_rate_slope_2 !== undefined && object.stable_rate_slope_2 !== null) { + message.stableRateSlope2 = object.stable_rate_slope_2; + } + if (object.optimal_stable_to_total_debt_ratio !== undefined && object.optimal_stable_to_total_debt_ratio !== null) { + message.optimalStableToTotalDebtRatio = object.optimal_stable_to_total_debt_ratio; + } + return message; + }, + toAmino(message: RateStrategyParams, useInterfaces: boolean = false): RateStrategyParamsAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.optimal_usage = message.optimalUsage === null ? undefined : message.optimalUsage; + obj.base_variable_borrow_rate = message.baseVariableBorrowRate === null ? undefined : message.baseVariableBorrowRate; + obj.variable_rate_slope_1 = message.variableRateSlope1 === null ? undefined : message.variableRateSlope1; + obj.variable_rate_slope_2 = message.variableRateSlope2 === null ? undefined : message.variableRateSlope2; + obj.base_stable_borrow_rate = message.baseStableBorrowRate === null ? undefined : message.baseStableBorrowRate; + obj.stable_rate_slope_1 = message.stableRateSlope1 === null ? undefined : message.stableRateSlope1; + obj.stable_rate_slope_2 = message.stableRateSlope2 === null ? undefined : message.stableRateSlope2; + obj.optimal_stable_to_total_debt_ratio = message.optimalStableToTotalDebtRatio === null ? undefined : message.optimalStableToTotalDebtRatio; + return obj; + }, + fromAminoMsg(object: RateStrategyParamsAminoMsg): RateStrategyParams { + return RateStrategyParams.fromAmino(object.value); + }, + fromProtoMsg(message: RateStrategyParamsProtoMsg, useInterfaces: boolean = false): RateStrategyParams { + return RateStrategyParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RateStrategyParams): Uint8Array { + return RateStrategyParams.encode(message).finish(); + }, + toProtoMsg(message: RateStrategyParams): RateStrategyParamsProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.RateStrategyParams", + value: RateStrategyParams.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/reward_scheme.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/reward_scheme.ts new file mode 100644 index 000000000..63463adb5 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/reward_scheme.ts @@ -0,0 +1,670 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { StringValue, StringValueAmino, StringValueSDKType } from "../../../google/protobuf/wrappers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { Decimal } from "@cosmjs/math"; +export interface RewardScheme { + id: bigint; + creator: string; + rewardDenom: string; + assetDenom: string; + rewardType: string; + rewardAmountPerSecond: string; + startTime: Date | undefined; + endTime: Date | undefined; + rewardPerShareLastUpdatedAt: Date | undefined; + rewardPerShare: string; +} +export interface RewardSchemeProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.RewardScheme"; + value: Uint8Array; +} +export interface RewardSchemeAmino { + id?: string; + creator?: string; + reward_denom?: string; + asset_denom?: string; + reward_type?: string; + reward_amount_per_second?: string; + start_time?: string | undefined; + end_time?: string | undefined; + reward_per_share_last_updated_at?: string | undefined; + reward_per_share?: string; +} +export interface RewardSchemeAminoMsg { + type: "/Switcheo.carbon.cdp.RewardScheme"; + value: RewardSchemeAmino; +} +export interface RewardSchemeSDKType { + id: bigint; + creator: string; + reward_denom: string; + asset_denom: string; + reward_type: string; + reward_amount_per_second: string; + start_time: Date | undefined; + end_time: Date | undefined; + reward_per_share_last_updated_at: Date | undefined; + reward_per_share: string; +} +export interface CreateRewardSchemeParams { + rewardDenom: string; + assetDenom: string; + rewardType: string; + rewardAmountPerSecond: string; + startTime: Date | undefined; + endTime: Date | undefined; +} +export interface CreateRewardSchemeParamsProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.CreateRewardSchemeParams"; + value: Uint8Array; +} +export interface CreateRewardSchemeParamsAmino { + reward_denom?: string; + asset_denom?: string; + reward_type?: string; + reward_amount_per_second?: string; + start_time?: string | undefined; + end_time?: string | undefined; +} +export interface CreateRewardSchemeParamsAminoMsg { + type: "/Switcheo.carbon.cdp.CreateRewardSchemeParams"; + value: CreateRewardSchemeParamsAmino; +} +export interface CreateRewardSchemeParamsSDKType { + reward_denom: string; + asset_denom: string; + reward_type: string; + reward_amount_per_second: string; + start_time: Date | undefined; + end_time: Date | undefined; +} +export interface UpdateRewardSchemeParams { + rewardSchemeId: bigint; + rewardDenom?: StringValue | undefined; + assetDenom?: StringValue | undefined; + rewardType?: StringValue | undefined; + rewardAmountPerSecond?: string; + startTime?: Date | undefined; + endTime?: Date | undefined; +} +export interface UpdateRewardSchemeParamsProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.UpdateRewardSchemeParams"; + value: Uint8Array; +} +export interface UpdateRewardSchemeParamsAmino { + reward_scheme_id?: string; + reward_denom?: StringValueAmino | undefined; + asset_denom?: StringValueAmino | undefined; + reward_type?: StringValueAmino | undefined; + reward_amount_per_second?: string; + start_time?: string | undefined; + end_time?: string | undefined; +} +export interface UpdateRewardSchemeParamsAminoMsg { + type: "/Switcheo.carbon.cdp.UpdateRewardSchemeParams"; + value: UpdateRewardSchemeParamsAmino; +} +export interface UpdateRewardSchemeParamsSDKType { + reward_scheme_id: bigint; + reward_denom?: StringValueSDKType | undefined; + asset_denom?: StringValueSDKType | undefined; + reward_type?: StringValueSDKType | undefined; + reward_amount_per_second?: string; + start_time?: Date | undefined; + end_time?: Date | undefined; +} +export interface RewardDebt { + userAddress: string; + rewardSchemeId: bigint; + rewardDebt: string; + lastUpdatedAt: Date | undefined; +} +export interface RewardDebtProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.RewardDebt"; + value: Uint8Array; +} +export interface RewardDebtAmino { + user_address?: string; + reward_scheme_id?: string; + reward_debt?: string; + last_updated_at?: string | undefined; +} +export interface RewardDebtAminoMsg { + type: "/Switcheo.carbon.cdp.RewardDebt"; + value: RewardDebtAmino; +} +export interface RewardDebtSDKType { + user_address: string; + reward_scheme_id: bigint; + reward_debt: string; + last_updated_at: Date | undefined; +} +function createBaseRewardScheme(): RewardScheme { + return { + id: BigInt(0), + creator: "", + rewardDenom: "", + assetDenom: "", + rewardType: "", + rewardAmountPerSecond: "", + startTime: new Date(), + endTime: new Date(), + rewardPerShareLastUpdatedAt: new Date(), + rewardPerShare: "" + }; +} +export const RewardScheme = { + typeUrl: "/Switcheo.carbon.cdp.RewardScheme", + encode(message: RewardScheme, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.rewardDenom !== "") { + writer.uint32(26).string(message.rewardDenom); + } + if (message.assetDenom !== "") { + writer.uint32(34).string(message.assetDenom); + } + if (message.rewardType !== "") { + writer.uint32(42).string(message.rewardType); + } + if (message.rewardAmountPerSecond !== "") { + writer.uint32(50).string(message.rewardAmountPerSecond); + } + if (message.startTime !== undefined) { + Timestamp.encode(toTimestamp(message.startTime), writer.uint32(58).fork()).ldelim(); + } + if (message.endTime !== undefined) { + Timestamp.encode(toTimestamp(message.endTime), writer.uint32(66).fork()).ldelim(); + } + if (message.rewardPerShareLastUpdatedAt !== undefined) { + Timestamp.encode(toTimestamp(message.rewardPerShareLastUpdatedAt), writer.uint32(74).fork()).ldelim(); + } + if (message.rewardPerShare !== "") { + writer.uint32(82).string(Decimal.fromUserInput(message.rewardPerShare, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RewardScheme { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewardScheme(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.rewardDenom = reader.string(); + break; + case 4: + message.assetDenom = reader.string(); + break; + case 5: + message.rewardType = reader.string(); + break; + case 6: + message.rewardAmountPerSecond = reader.string(); + break; + case 7: + message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 8: + message.endTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 9: + message.rewardPerShareLastUpdatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 10: + message.rewardPerShare = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RewardScheme { + const message = createBaseRewardScheme(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.rewardDenom = object.rewardDenom ?? ""; + message.assetDenom = object.assetDenom ?? ""; + message.rewardType = object.rewardType ?? ""; + message.rewardAmountPerSecond = object.rewardAmountPerSecond ?? ""; + message.startTime = object.startTime ?? undefined; + message.endTime = object.endTime ?? undefined; + message.rewardPerShareLastUpdatedAt = object.rewardPerShareLastUpdatedAt ?? undefined; + message.rewardPerShare = object.rewardPerShare ?? ""; + return message; + }, + fromAmino(object: RewardSchemeAmino): RewardScheme { + const message = createBaseRewardScheme(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.reward_denom !== undefined && object.reward_denom !== null) { + message.rewardDenom = object.reward_denom; + } + if (object.asset_denom !== undefined && object.asset_denom !== null) { + message.assetDenom = object.asset_denom; + } + if (object.reward_type !== undefined && object.reward_type !== null) { + message.rewardType = object.reward_type; + } + if (object.reward_amount_per_second !== undefined && object.reward_amount_per_second !== null) { + message.rewardAmountPerSecond = object.reward_amount_per_second; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + if (object.reward_per_share_last_updated_at !== undefined && object.reward_per_share_last_updated_at !== null) { + message.rewardPerShareLastUpdatedAt = fromTimestamp(Timestamp.fromAmino(object.reward_per_share_last_updated_at)); + } + if (object.reward_per_share !== undefined && object.reward_per_share !== null) { + message.rewardPerShare = object.reward_per_share; + } + return message; + }, + toAmino(message: RewardScheme, useInterfaces: boolean = false): RewardSchemeAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.reward_denom = message.rewardDenom === "" ? undefined : message.rewardDenom; + obj.asset_denom = message.assetDenom === "" ? undefined : message.assetDenom; + obj.reward_type = message.rewardType === "" ? undefined : message.rewardType; + obj.reward_amount_per_second = message.rewardAmountPerSecond === "" ? undefined : message.rewardAmountPerSecond; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; + obj.reward_per_share_last_updated_at = message.rewardPerShareLastUpdatedAt ? Timestamp.toAmino(toTimestamp(message.rewardPerShareLastUpdatedAt)) : undefined; + obj.reward_per_share = message.rewardPerShare === "" ? undefined : message.rewardPerShare; + return obj; + }, + fromAminoMsg(object: RewardSchemeAminoMsg): RewardScheme { + return RewardScheme.fromAmino(object.value); + }, + fromProtoMsg(message: RewardSchemeProtoMsg, useInterfaces: boolean = false): RewardScheme { + return RewardScheme.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RewardScheme): Uint8Array { + return RewardScheme.encode(message).finish(); + }, + toProtoMsg(message: RewardScheme): RewardSchemeProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.RewardScheme", + value: RewardScheme.encode(message).finish() + }; + } +}; +function createBaseCreateRewardSchemeParams(): CreateRewardSchemeParams { + return { + rewardDenom: "", + assetDenom: "", + rewardType: "", + rewardAmountPerSecond: "", + startTime: new Date(), + endTime: new Date() + }; +} +export const CreateRewardSchemeParams = { + typeUrl: "/Switcheo.carbon.cdp.CreateRewardSchemeParams", + encode(message: CreateRewardSchemeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rewardDenom !== "") { + writer.uint32(10).string(message.rewardDenom); + } + if (message.assetDenom !== "") { + writer.uint32(18).string(message.assetDenom); + } + if (message.rewardType !== "") { + writer.uint32(26).string(message.rewardType); + } + if (message.rewardAmountPerSecond !== "") { + writer.uint32(34).string(message.rewardAmountPerSecond); + } + if (message.startTime !== undefined) { + Timestamp.encode(toTimestamp(message.startTime), writer.uint32(42).fork()).ldelim(); + } + if (message.endTime !== undefined) { + Timestamp.encode(toTimestamp(message.endTime), writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CreateRewardSchemeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateRewardSchemeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardDenom = reader.string(); + break; + case 2: + message.assetDenom = reader.string(); + break; + case 3: + message.rewardType = reader.string(); + break; + case 4: + message.rewardAmountPerSecond = reader.string(); + break; + case 5: + message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.endTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CreateRewardSchemeParams { + const message = createBaseCreateRewardSchemeParams(); + message.rewardDenom = object.rewardDenom ?? ""; + message.assetDenom = object.assetDenom ?? ""; + message.rewardType = object.rewardType ?? ""; + message.rewardAmountPerSecond = object.rewardAmountPerSecond ?? ""; + message.startTime = object.startTime ?? undefined; + message.endTime = object.endTime ?? undefined; + return message; + }, + fromAmino(object: CreateRewardSchemeParamsAmino): CreateRewardSchemeParams { + const message = createBaseCreateRewardSchemeParams(); + if (object.reward_denom !== undefined && object.reward_denom !== null) { + message.rewardDenom = object.reward_denom; + } + if (object.asset_denom !== undefined && object.asset_denom !== null) { + message.assetDenom = object.asset_denom; + } + if (object.reward_type !== undefined && object.reward_type !== null) { + message.rewardType = object.reward_type; + } + if (object.reward_amount_per_second !== undefined && object.reward_amount_per_second !== null) { + message.rewardAmountPerSecond = object.reward_amount_per_second; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + return message; + }, + toAmino(message: CreateRewardSchemeParams, useInterfaces: boolean = false): CreateRewardSchemeParamsAmino { + const obj: any = {}; + obj.reward_denom = message.rewardDenom === "" ? undefined : message.rewardDenom; + obj.asset_denom = message.assetDenom === "" ? undefined : message.assetDenom; + obj.reward_type = message.rewardType === "" ? undefined : message.rewardType; + obj.reward_amount_per_second = message.rewardAmountPerSecond === "" ? undefined : message.rewardAmountPerSecond; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; + return obj; + }, + fromAminoMsg(object: CreateRewardSchemeParamsAminoMsg): CreateRewardSchemeParams { + return CreateRewardSchemeParams.fromAmino(object.value); + }, + fromProtoMsg(message: CreateRewardSchemeParamsProtoMsg, useInterfaces: boolean = false): CreateRewardSchemeParams { + return CreateRewardSchemeParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CreateRewardSchemeParams): Uint8Array { + return CreateRewardSchemeParams.encode(message).finish(); + }, + toProtoMsg(message: CreateRewardSchemeParams): CreateRewardSchemeParamsProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.CreateRewardSchemeParams", + value: CreateRewardSchemeParams.encode(message).finish() + }; + } +}; +function createBaseUpdateRewardSchemeParams(): UpdateRewardSchemeParams { + return { + rewardSchemeId: BigInt(0), + rewardDenom: undefined, + assetDenom: undefined, + rewardType: undefined, + rewardAmountPerSecond: undefined, + startTime: undefined, + endTime: undefined + }; +} +export const UpdateRewardSchemeParams = { + typeUrl: "/Switcheo.carbon.cdp.UpdateRewardSchemeParams", + encode(message: UpdateRewardSchemeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rewardSchemeId !== BigInt(0)) { + writer.uint32(8).uint64(message.rewardSchemeId); + } + if (message.rewardDenom !== undefined) { + StringValue.encode(message.rewardDenom, writer.uint32(18).fork()).ldelim(); + } + if (message.assetDenom !== undefined) { + StringValue.encode(message.assetDenom, writer.uint32(26).fork()).ldelim(); + } + if (message.rewardType !== undefined) { + StringValue.encode(message.rewardType, writer.uint32(34).fork()).ldelim(); + } + if (message.rewardAmountPerSecond !== undefined) { + writer.uint32(42).string(message.rewardAmountPerSecond); + } + if (message.startTime !== undefined) { + Timestamp.encode(toTimestamp(message.startTime), writer.uint32(50).fork()).ldelim(); + } + if (message.endTime !== undefined) { + Timestamp.encode(toTimestamp(message.endTime), writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UpdateRewardSchemeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateRewardSchemeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewardSchemeId = reader.uint64(); + break; + case 2: + message.rewardDenom = StringValue.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.assetDenom = StringValue.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.rewardType = StringValue.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.rewardAmountPerSecond = reader.string(); + break; + case 6: + message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.endTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateRewardSchemeParams { + const message = createBaseUpdateRewardSchemeParams(); + message.rewardSchemeId = object.rewardSchemeId !== undefined && object.rewardSchemeId !== null ? BigInt(object.rewardSchemeId.toString()) : BigInt(0); + message.rewardDenom = object.rewardDenom !== undefined && object.rewardDenom !== null ? StringValue.fromPartial(object.rewardDenom) : undefined; + message.assetDenom = object.assetDenom !== undefined && object.assetDenom !== null ? StringValue.fromPartial(object.assetDenom) : undefined; + message.rewardType = object.rewardType !== undefined && object.rewardType !== null ? StringValue.fromPartial(object.rewardType) : undefined; + message.rewardAmountPerSecond = object.rewardAmountPerSecond ?? undefined; + message.startTime = object.startTime ?? undefined; + message.endTime = object.endTime ?? undefined; + return message; + }, + fromAmino(object: UpdateRewardSchemeParamsAmino): UpdateRewardSchemeParams { + const message = createBaseUpdateRewardSchemeParams(); + if (object.reward_scheme_id !== undefined && object.reward_scheme_id !== null) { + message.rewardSchemeId = BigInt(object.reward_scheme_id); + } + if (object.reward_denom !== undefined && object.reward_denom !== null) { + message.rewardDenom = StringValue.fromAmino(object.reward_denom); + } + if (object.asset_denom !== undefined && object.asset_denom !== null) { + message.assetDenom = StringValue.fromAmino(object.asset_denom); + } + if (object.reward_type !== undefined && object.reward_type !== null) { + message.rewardType = StringValue.fromAmino(object.reward_type); + } + if (object.reward_amount_per_second !== undefined && object.reward_amount_per_second !== null) { + message.rewardAmountPerSecond = object.reward_amount_per_second; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + return message; + }, + toAmino(message: UpdateRewardSchemeParams, useInterfaces: boolean = false): UpdateRewardSchemeParamsAmino { + const obj: any = {}; + obj.reward_scheme_id = message.rewardSchemeId !== BigInt(0) ? message.rewardSchemeId.toString() : undefined; + obj.reward_denom = message.rewardDenom ? StringValue.toAmino(message.rewardDenom, useInterfaces) : undefined; + obj.asset_denom = message.assetDenom ? StringValue.toAmino(message.assetDenom, useInterfaces) : undefined; + obj.reward_type = message.rewardType ? StringValue.toAmino(message.rewardType, useInterfaces) : undefined; + obj.reward_amount_per_second = message.rewardAmountPerSecond === null ? undefined : message.rewardAmountPerSecond; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; + return obj; + }, + fromAminoMsg(object: UpdateRewardSchemeParamsAminoMsg): UpdateRewardSchemeParams { + return UpdateRewardSchemeParams.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateRewardSchemeParamsProtoMsg, useInterfaces: boolean = false): UpdateRewardSchemeParams { + return UpdateRewardSchemeParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UpdateRewardSchemeParams): Uint8Array { + return UpdateRewardSchemeParams.encode(message).finish(); + }, + toProtoMsg(message: UpdateRewardSchemeParams): UpdateRewardSchemeParamsProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.UpdateRewardSchemeParams", + value: UpdateRewardSchemeParams.encode(message).finish() + }; + } +}; +function createBaseRewardDebt(): RewardDebt { + return { + userAddress: "", + rewardSchemeId: BigInt(0), + rewardDebt: "", + lastUpdatedAt: new Date() + }; +} +export const RewardDebt = { + typeUrl: "/Switcheo.carbon.cdp.RewardDebt", + encode(message: RewardDebt, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.userAddress !== "") { + writer.uint32(10).string(message.userAddress); + } + if (message.rewardSchemeId !== BigInt(0)) { + writer.uint32(16).uint64(message.rewardSchemeId); + } + if (message.rewardDebt !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.rewardDebt, 18).atomics); + } + if (message.lastUpdatedAt !== undefined) { + Timestamp.encode(toTimestamp(message.lastUpdatedAt), writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RewardDebt { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewardDebt(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userAddress = reader.string(); + break; + case 2: + message.rewardSchemeId = reader.uint64(); + break; + case 3: + message.rewardDebt = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.lastUpdatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RewardDebt { + const message = createBaseRewardDebt(); + message.userAddress = object.userAddress ?? ""; + message.rewardSchemeId = object.rewardSchemeId !== undefined && object.rewardSchemeId !== null ? BigInt(object.rewardSchemeId.toString()) : BigInt(0); + message.rewardDebt = object.rewardDebt ?? ""; + message.lastUpdatedAt = object.lastUpdatedAt ?? undefined; + return message; + }, + fromAmino(object: RewardDebtAmino): RewardDebt { + const message = createBaseRewardDebt(); + if (object.user_address !== undefined && object.user_address !== null) { + message.userAddress = object.user_address; + } + if (object.reward_scheme_id !== undefined && object.reward_scheme_id !== null) { + message.rewardSchemeId = BigInt(object.reward_scheme_id); + } + if (object.reward_debt !== undefined && object.reward_debt !== null) { + message.rewardDebt = object.reward_debt; + } + if (object.last_updated_at !== undefined && object.last_updated_at !== null) { + message.lastUpdatedAt = fromTimestamp(Timestamp.fromAmino(object.last_updated_at)); + } + return message; + }, + toAmino(message: RewardDebt, useInterfaces: boolean = false): RewardDebtAmino { + const obj: any = {}; + obj.user_address = message.userAddress === "" ? undefined : message.userAddress; + obj.reward_scheme_id = message.rewardSchemeId !== BigInt(0) ? message.rewardSchemeId.toString() : undefined; + obj.reward_debt = message.rewardDebt === "" ? undefined : message.rewardDebt; + obj.last_updated_at = message.lastUpdatedAt ? Timestamp.toAmino(toTimestamp(message.lastUpdatedAt)) : undefined; + return obj; + }, + fromAminoMsg(object: RewardDebtAminoMsg): RewardDebt { + return RewardDebt.fromAmino(object.value); + }, + fromProtoMsg(message: RewardDebtProtoMsg, useInterfaces: boolean = false): RewardDebt { + return RewardDebt.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RewardDebt): Uint8Array { + return RewardDebt.encode(message).finish(); + }, + toProtoMsg(message: RewardDebt): RewardDebtProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.RewardDebt", + value: RewardDebt.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/stablecoin_debt_info.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/stablecoin_debt_info.ts new file mode 100644 index 000000000..8055dc29c --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/stablecoin_debt_info.ts @@ -0,0 +1,144 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { Decimal } from "@cosmjs/math"; +export interface StablecoinDebtInfo { + denom: string; + lastUpdatedTime: Date | undefined; + totalPrincipal: string; + cumulativeInterestMultiplier: string; + totalAccumulatedInterest: string; +} +export interface StablecoinDebtInfoProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.StablecoinDebtInfo"; + value: Uint8Array; +} +export interface StablecoinDebtInfoAmino { + denom?: string; + last_updated_time?: string | undefined; + total_principal?: string; + cumulative_interest_multiplier?: string; + total_accumulated_interest?: string; +} +export interface StablecoinDebtInfoAminoMsg { + type: "/Switcheo.carbon.cdp.StablecoinDebtInfo"; + value: StablecoinDebtInfoAmino; +} +export interface StablecoinDebtInfoSDKType { + denom: string; + last_updated_time: Date | undefined; + total_principal: string; + cumulative_interest_multiplier: string; + total_accumulated_interest: string; +} +function createBaseStablecoinDebtInfo(): StablecoinDebtInfo { + return { + denom: "", + lastUpdatedTime: new Date(), + totalPrincipal: "", + cumulativeInterestMultiplier: "", + totalAccumulatedInterest: "" + }; +} +export const StablecoinDebtInfo = { + typeUrl: "/Switcheo.carbon.cdp.StablecoinDebtInfo", + encode(message: StablecoinDebtInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.lastUpdatedTime !== undefined) { + Timestamp.encode(toTimestamp(message.lastUpdatedTime), writer.uint32(18).fork()).ldelim(); + } + if (message.totalPrincipal !== "") { + writer.uint32(26).string(message.totalPrincipal); + } + if (message.cumulativeInterestMultiplier !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.cumulativeInterestMultiplier, 18).atomics); + } + if (message.totalAccumulatedInterest !== "") { + writer.uint32(42).string(message.totalAccumulatedInterest); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): StablecoinDebtInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStablecoinDebtInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.lastUpdatedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.totalPrincipal = reader.string(); + break; + case 4: + message.cumulativeInterestMultiplier = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.totalAccumulatedInterest = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StablecoinDebtInfo { + const message = createBaseStablecoinDebtInfo(); + message.denom = object.denom ?? ""; + message.lastUpdatedTime = object.lastUpdatedTime ?? undefined; + message.totalPrincipal = object.totalPrincipal ?? ""; + message.cumulativeInterestMultiplier = object.cumulativeInterestMultiplier ?? ""; + message.totalAccumulatedInterest = object.totalAccumulatedInterest ?? ""; + return message; + }, + fromAmino(object: StablecoinDebtInfoAmino): StablecoinDebtInfo { + const message = createBaseStablecoinDebtInfo(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.last_updated_time !== undefined && object.last_updated_time !== null) { + message.lastUpdatedTime = fromTimestamp(Timestamp.fromAmino(object.last_updated_time)); + } + if (object.total_principal !== undefined && object.total_principal !== null) { + message.totalPrincipal = object.total_principal; + } + if (object.cumulative_interest_multiplier !== undefined && object.cumulative_interest_multiplier !== null) { + message.cumulativeInterestMultiplier = object.cumulative_interest_multiplier; + } + if (object.total_accumulated_interest !== undefined && object.total_accumulated_interest !== null) { + message.totalAccumulatedInterest = object.total_accumulated_interest; + } + return message; + }, + toAmino(message: StablecoinDebtInfo, useInterfaces: boolean = false): StablecoinDebtInfoAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.last_updated_time = message.lastUpdatedTime ? Timestamp.toAmino(toTimestamp(message.lastUpdatedTime)) : undefined; + obj.total_principal = message.totalPrincipal === "" ? undefined : message.totalPrincipal; + obj.cumulative_interest_multiplier = message.cumulativeInterestMultiplier === "" ? undefined : message.cumulativeInterestMultiplier; + obj.total_accumulated_interest = message.totalAccumulatedInterest === "" ? undefined : message.totalAccumulatedInterest; + return obj; + }, + fromAminoMsg(object: StablecoinDebtInfoAminoMsg): StablecoinDebtInfo { + return StablecoinDebtInfo.fromAmino(object.value); + }, + fromProtoMsg(message: StablecoinDebtInfoProtoMsg, useInterfaces: boolean = false): StablecoinDebtInfo { + return StablecoinDebtInfo.decode(message.value, undefined, useInterfaces); + }, + toProto(message: StablecoinDebtInfo): Uint8Array { + return StablecoinDebtInfo.encode(message).finish(); + }, + toProtoMsg(message: StablecoinDebtInfo): StablecoinDebtInfoProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.StablecoinDebtInfo", + value: StablecoinDebtInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/stablecoin_interest_info.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/stablecoin_interest_info.ts new file mode 100644 index 000000000..e10d28632 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/stablecoin_interest_info.ts @@ -0,0 +1,99 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { Decimal } from "@cosmjs/math"; +export interface StablecoinInterestInfo { + lastUpdatedTime: Date | undefined; + stablecoinInterestRate: string; +} +export interface StablecoinInterestInfoProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.StablecoinInterestInfo"; + value: Uint8Array; +} +export interface StablecoinInterestInfoAmino { + last_updated_time?: string | undefined; + stablecoin_interest_rate?: string; +} +export interface StablecoinInterestInfoAminoMsg { + type: "/Switcheo.carbon.cdp.StablecoinInterestInfo"; + value: StablecoinInterestInfoAmino; +} +export interface StablecoinInterestInfoSDKType { + last_updated_time: Date | undefined; + stablecoin_interest_rate: string; +} +function createBaseStablecoinInterestInfo(): StablecoinInterestInfo { + return { + lastUpdatedTime: new Date(), + stablecoinInterestRate: "" + }; +} +export const StablecoinInterestInfo = { + typeUrl: "/Switcheo.carbon.cdp.StablecoinInterestInfo", + encode(message: StablecoinInterestInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lastUpdatedTime !== undefined) { + Timestamp.encode(toTimestamp(message.lastUpdatedTime), writer.uint32(10).fork()).ldelim(); + } + if (message.stablecoinInterestRate !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.stablecoinInterestRate, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): StablecoinInterestInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStablecoinInterestInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastUpdatedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.stablecoinInterestRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StablecoinInterestInfo { + const message = createBaseStablecoinInterestInfo(); + message.lastUpdatedTime = object.lastUpdatedTime ?? undefined; + message.stablecoinInterestRate = object.stablecoinInterestRate ?? ""; + return message; + }, + fromAmino(object: StablecoinInterestInfoAmino): StablecoinInterestInfo { + const message = createBaseStablecoinInterestInfo(); + if (object.last_updated_time !== undefined && object.last_updated_time !== null) { + message.lastUpdatedTime = fromTimestamp(Timestamp.fromAmino(object.last_updated_time)); + } + if (object.stablecoin_interest_rate !== undefined && object.stablecoin_interest_rate !== null) { + message.stablecoinInterestRate = object.stablecoin_interest_rate; + } + return message; + }, + toAmino(message: StablecoinInterestInfo, useInterfaces: boolean = false): StablecoinInterestInfoAmino { + const obj: any = {}; + obj.last_updated_time = message.lastUpdatedTime ? Timestamp.toAmino(toTimestamp(message.lastUpdatedTime)) : undefined; + obj.stablecoin_interest_rate = message.stablecoinInterestRate === "" ? undefined : message.stablecoinInterestRate; + return obj; + }, + fromAminoMsg(object: StablecoinInterestInfoAminoMsg): StablecoinInterestInfo { + return StablecoinInterestInfo.fromAmino(object.value); + }, + fromProtoMsg(message: StablecoinInterestInfoProtoMsg, useInterfaces: boolean = false): StablecoinInterestInfo { + return StablecoinInterestInfo.decode(message.value, undefined, useInterfaces); + }, + toProto(message: StablecoinInterestInfo): Uint8Array { + return StablecoinInterestInfo.encode(message).finish(); + }, + toProtoMsg(message: StablecoinInterestInfo): StablecoinInterestInfoProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.StablecoinInterestInfo", + value: StablecoinInterestInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.amino.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.amino.ts new file mode 100644 index 000000000..fb5b60fe2 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.amino.ts @@ -0,0 +1,173 @@ +import { MsgAddRateStrategy, MsgRemoveRateStrategy, MsgAddAsset, MsgUpdateRateStrategy, MsgUpdateAsset, MsgSupplyAsset, MsgWithdrawAsset, MsgLockCollateral, MsgUnlockCollateral, MsgBorrowAsset, MsgRepayAsset, MsgSupplyAssetAndLockCollateral, MsgUnlockCollateralAndWithdrawAsset, MsgLiquidateCollateral, MsgSetLiquidationFee, MsgSetInterestFee, MsgCreateRewardScheme, MsgUpdateRewardScheme, MsgClaimRewards, MsgSetStablecoinInterestRate, MsgSetStablecoinMintCap, MsgMintStablecoin, MsgReturnStablecoin, MsgSetCompleteLiquidationThreshold, MsgSetMinimumCloseFactor, MsgSetSmallLiquidationSize, MsgSetStalePriceGracePeriod, MsgSetCdpPaused, MsgConvertTokenInCdpToGroupTokens, MsgAddEModeCategory, MsgUpdateEModeCategory, MsgSetAccountEMode, MsgRemoveAccountEMode, MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/Switcheo.carbon.cdp.MsgAddRateStrategy": { + aminoType: "cdp/AddRateStrategy", + toAmino: MsgAddRateStrategy.toAmino, + fromAmino: MsgAddRateStrategy.fromAmino + }, + "/Switcheo.carbon.cdp.MsgRemoveRateStrategy": { + aminoType: "cdp/RemoveRateStrategy", + toAmino: MsgRemoveRateStrategy.toAmino, + fromAmino: MsgRemoveRateStrategy.fromAmino + }, + "/Switcheo.carbon.cdp.MsgAddAsset": { + aminoType: "cdp/AddAsset", + toAmino: MsgAddAsset.toAmino, + fromAmino: MsgAddAsset.fromAmino + }, + "/Switcheo.carbon.cdp.MsgUpdateRateStrategy": { + aminoType: "cdp/UpdateRateStrategy", + toAmino: MsgUpdateRateStrategy.toAmino, + fromAmino: MsgUpdateRateStrategy.fromAmino + }, + "/Switcheo.carbon.cdp.MsgUpdateAsset": { + aminoType: "cdp/UpdateAsset", + toAmino: MsgUpdateAsset.toAmino, + fromAmino: MsgUpdateAsset.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSupplyAsset": { + aminoType: "cdp/SupplyAsset", + toAmino: MsgSupplyAsset.toAmino, + fromAmino: MsgSupplyAsset.fromAmino + }, + "/Switcheo.carbon.cdp.MsgWithdrawAsset": { + aminoType: "cdp/WithdrawAsset", + toAmino: MsgWithdrawAsset.toAmino, + fromAmino: MsgWithdrawAsset.fromAmino + }, + "/Switcheo.carbon.cdp.MsgLockCollateral": { + aminoType: "cdp/LockCollateral", + toAmino: MsgLockCollateral.toAmino, + fromAmino: MsgLockCollateral.fromAmino + }, + "/Switcheo.carbon.cdp.MsgUnlockCollateral": { + aminoType: "cdp/UnlockCollateral", + toAmino: MsgUnlockCollateral.toAmino, + fromAmino: MsgUnlockCollateral.fromAmino + }, + "/Switcheo.carbon.cdp.MsgBorrowAsset": { + aminoType: "cdp/BorrowAsset", + toAmino: MsgBorrowAsset.toAmino, + fromAmino: MsgBorrowAsset.fromAmino + }, + "/Switcheo.carbon.cdp.MsgRepayAsset": { + aminoType: "cdp/RepayAsset", + toAmino: MsgRepayAsset.toAmino, + fromAmino: MsgRepayAsset.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateral": { + aminoType: "cdp/SupplyAssetAndLockCollateral", + toAmino: MsgSupplyAssetAndLockCollateral.toAmino, + fromAmino: MsgSupplyAssetAndLockCollateral.fromAmino + }, + "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAsset": { + aminoType: "cdp/UnlockCollateralAndWithdrawAsset", + toAmino: MsgUnlockCollateralAndWithdrawAsset.toAmino, + fromAmino: MsgUnlockCollateralAndWithdrawAsset.fromAmino + }, + "/Switcheo.carbon.cdp.MsgLiquidateCollateral": { + aminoType: "cdp/LiquidateCollateral", + toAmino: MsgLiquidateCollateral.toAmino, + fromAmino: MsgLiquidateCollateral.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSetLiquidationFee": { + aminoType: "cdp/SetLiquidationFee", + toAmino: MsgSetLiquidationFee.toAmino, + fromAmino: MsgSetLiquidationFee.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSetInterestFee": { + aminoType: "cdp/SetInterestFee", + toAmino: MsgSetInterestFee.toAmino, + fromAmino: MsgSetInterestFee.fromAmino + }, + "/Switcheo.carbon.cdp.MsgCreateRewardScheme": { + aminoType: "cdp/CreateRewardScheme", + toAmino: MsgCreateRewardScheme.toAmino, + fromAmino: MsgCreateRewardScheme.fromAmino + }, + "/Switcheo.carbon.cdp.MsgUpdateRewardScheme": { + aminoType: "cdp/UpdateRewardScheme", + toAmino: MsgUpdateRewardScheme.toAmino, + fromAmino: MsgUpdateRewardScheme.fromAmino + }, + "/Switcheo.carbon.cdp.MsgClaimRewards": { + aminoType: "cdp/ClaimRewards", + toAmino: MsgClaimRewards.toAmino, + fromAmino: MsgClaimRewards.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRate": { + aminoType: "cdp/SetStablecoinInterestRate", + toAmino: MsgSetStablecoinInterestRate.toAmino, + fromAmino: MsgSetStablecoinInterestRate.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSetStablecoinMintCap": { + aminoType: "cdp/SetStablecoinMintCap", + toAmino: MsgSetStablecoinMintCap.toAmino, + fromAmino: MsgSetStablecoinMintCap.fromAmino + }, + "/Switcheo.carbon.cdp.MsgMintStablecoin": { + aminoType: "cdp/MintStablecoin", + toAmino: MsgMintStablecoin.toAmino, + fromAmino: MsgMintStablecoin.fromAmino + }, + "/Switcheo.carbon.cdp.MsgReturnStablecoin": { + aminoType: "cdp/ReturnStablecoin", + toAmino: MsgReturnStablecoin.toAmino, + fromAmino: MsgReturnStablecoin.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThreshold": { + aminoType: "cdp/SetCompleteLiquidationThreshold", + toAmino: MsgSetCompleteLiquidationThreshold.toAmino, + fromAmino: MsgSetCompleteLiquidationThreshold.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactor": { + aminoType: "cdp/SetMinimumCloseFactor", + toAmino: MsgSetMinimumCloseFactor.toAmino, + fromAmino: MsgSetMinimumCloseFactor.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSize": { + aminoType: "cdp/SetSmallLiquidationSize", + toAmino: MsgSetSmallLiquidationSize.toAmino, + fromAmino: MsgSetSmallLiquidationSize.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriod": { + aminoType: "cdp/SetStalePriceGracePeriod", + toAmino: MsgSetStalePriceGracePeriod.toAmino, + fromAmino: MsgSetStalePriceGracePeriod.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSetCdpPaused": { + aminoType: "cdp/SetCdpPaused", + toAmino: MsgSetCdpPaused.toAmino, + fromAmino: MsgSetCdpPaused.fromAmino + }, + "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokens": { + aminoType: "cdp/ConvertTokenInCdpToGroupTokens", + toAmino: MsgConvertTokenInCdpToGroupTokens.toAmino, + fromAmino: MsgConvertTokenInCdpToGroupTokens.fromAmino + }, + "/Switcheo.carbon.cdp.MsgAddEModeCategory": { + aminoType: "cdp/AddEModeCategory", + toAmino: MsgAddEModeCategory.toAmino, + fromAmino: MsgAddEModeCategory.fromAmino + }, + "/Switcheo.carbon.cdp.MsgUpdateEModeCategory": { + aminoType: "cdp/UpdateEModeCategory", + toAmino: MsgUpdateEModeCategory.toAmino, + fromAmino: MsgUpdateEModeCategory.fromAmino + }, + "/Switcheo.carbon.cdp.MsgSetAccountEMode": { + aminoType: "cdp/SetAccountEMode", + toAmino: MsgSetAccountEMode.toAmino, + fromAmino: MsgSetAccountEMode.fromAmino + }, + "/Switcheo.carbon.cdp.MsgRemoveAccountEMode": { + aminoType: "cdp/RemoveAccountEMode", + toAmino: MsgRemoveAccountEMode.toAmino, + fromAmino: MsgRemoveAccountEMode.fromAmino + }, + "/Switcheo.carbon.cdp.MsgUpdateParams": { + aminoType: "cdp/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.registry.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.registry.ts new file mode 100644 index 000000000..0814d02d9 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.registry.ts @@ -0,0 +1,629 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgAddRateStrategy, MsgRemoveRateStrategy, MsgAddAsset, MsgUpdateRateStrategy, MsgUpdateAsset, MsgSupplyAsset, MsgWithdrawAsset, MsgLockCollateral, MsgUnlockCollateral, MsgBorrowAsset, MsgRepayAsset, MsgSupplyAssetAndLockCollateral, MsgUnlockCollateralAndWithdrawAsset, MsgLiquidateCollateral, MsgSetLiquidationFee, MsgSetInterestFee, MsgCreateRewardScheme, MsgUpdateRewardScheme, MsgClaimRewards, MsgSetStablecoinInterestRate, MsgSetStablecoinMintCap, MsgMintStablecoin, MsgReturnStablecoin, MsgSetCompleteLiquidationThreshold, MsgSetMinimumCloseFactor, MsgSetSmallLiquidationSize, MsgSetStalePriceGracePeriod, MsgSetCdpPaused, MsgConvertTokenInCdpToGroupTokens, MsgAddEModeCategory, MsgUpdateEModeCategory, MsgSetAccountEMode, MsgRemoveAccountEMode, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/Switcheo.carbon.cdp.MsgAddRateStrategy", MsgAddRateStrategy], ["/Switcheo.carbon.cdp.MsgRemoveRateStrategy", MsgRemoveRateStrategy], ["/Switcheo.carbon.cdp.MsgAddAsset", MsgAddAsset], ["/Switcheo.carbon.cdp.MsgUpdateRateStrategy", MsgUpdateRateStrategy], ["/Switcheo.carbon.cdp.MsgUpdateAsset", MsgUpdateAsset], ["/Switcheo.carbon.cdp.MsgSupplyAsset", MsgSupplyAsset], ["/Switcheo.carbon.cdp.MsgWithdrawAsset", MsgWithdrawAsset], ["/Switcheo.carbon.cdp.MsgLockCollateral", MsgLockCollateral], ["/Switcheo.carbon.cdp.MsgUnlockCollateral", MsgUnlockCollateral], ["/Switcheo.carbon.cdp.MsgBorrowAsset", MsgBorrowAsset], ["/Switcheo.carbon.cdp.MsgRepayAsset", MsgRepayAsset], ["/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateral", MsgSupplyAssetAndLockCollateral], ["/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAsset", MsgUnlockCollateralAndWithdrawAsset], ["/Switcheo.carbon.cdp.MsgLiquidateCollateral", MsgLiquidateCollateral], ["/Switcheo.carbon.cdp.MsgSetLiquidationFee", MsgSetLiquidationFee], ["/Switcheo.carbon.cdp.MsgSetInterestFee", MsgSetInterestFee], ["/Switcheo.carbon.cdp.MsgCreateRewardScheme", MsgCreateRewardScheme], ["/Switcheo.carbon.cdp.MsgUpdateRewardScheme", MsgUpdateRewardScheme], ["/Switcheo.carbon.cdp.MsgClaimRewards", MsgClaimRewards], ["/Switcheo.carbon.cdp.MsgSetStablecoinInterestRate", MsgSetStablecoinInterestRate], ["/Switcheo.carbon.cdp.MsgSetStablecoinMintCap", MsgSetStablecoinMintCap], ["/Switcheo.carbon.cdp.MsgMintStablecoin", MsgMintStablecoin], ["/Switcheo.carbon.cdp.MsgReturnStablecoin", MsgReturnStablecoin], ["/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThreshold", MsgSetCompleteLiquidationThreshold], ["/Switcheo.carbon.cdp.MsgSetMinimumCloseFactor", MsgSetMinimumCloseFactor], ["/Switcheo.carbon.cdp.MsgSetSmallLiquidationSize", MsgSetSmallLiquidationSize], ["/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriod", MsgSetStalePriceGracePeriod], ["/Switcheo.carbon.cdp.MsgSetCdpPaused", MsgSetCdpPaused], ["/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokens", MsgConvertTokenInCdpToGroupTokens], ["/Switcheo.carbon.cdp.MsgAddEModeCategory", MsgAddEModeCategory], ["/Switcheo.carbon.cdp.MsgUpdateEModeCategory", MsgUpdateEModeCategory], ["/Switcheo.carbon.cdp.MsgSetAccountEMode", MsgSetAccountEMode], ["/Switcheo.carbon.cdp.MsgRemoveAccountEMode", MsgRemoveAccountEMode], ["/Switcheo.carbon.cdp.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + addRateStrategy(value: MsgAddRateStrategy) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddRateStrategy", + value: MsgAddRateStrategy.encode(value).finish() + }; + }, + removeRateStrategy(value: MsgRemoveRateStrategy) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveRateStrategy", + value: MsgRemoveRateStrategy.encode(value).finish() + }; + }, + addAsset(value: MsgAddAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddAsset", + value: MsgAddAsset.encode(value).finish() + }; + }, + updateRateStrategy(value: MsgUpdateRateStrategy) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRateStrategy", + value: MsgUpdateRateStrategy.encode(value).finish() + }; + }, + updateAsset(value: MsgUpdateAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateAsset", + value: MsgUpdateAsset.encode(value).finish() + }; + }, + supplyAsset(value: MsgSupplyAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAsset", + value: MsgSupplyAsset.encode(value).finish() + }; + }, + withdrawAsset(value: MsgWithdrawAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgWithdrawAsset", + value: MsgWithdrawAsset.encode(value).finish() + }; + }, + lockCollateral(value: MsgLockCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgLockCollateral", + value: MsgLockCollateral.encode(value).finish() + }; + }, + unlockCollateral(value: MsgUnlockCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateral", + value: MsgUnlockCollateral.encode(value).finish() + }; + }, + borrowAsset(value: MsgBorrowAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgBorrowAsset", + value: MsgBorrowAsset.encode(value).finish() + }; + }, + repayAsset(value: MsgRepayAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRepayAsset", + value: MsgRepayAsset.encode(value).finish() + }; + }, + supplyAssetAndLockCollateral(value: MsgSupplyAssetAndLockCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateral", + value: MsgSupplyAssetAndLockCollateral.encode(value).finish() + }; + }, + unlockCollateralAndWithdrawAsset(value: MsgUnlockCollateralAndWithdrawAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAsset", + value: MsgUnlockCollateralAndWithdrawAsset.encode(value).finish() + }; + }, + liquidateCollateral(value: MsgLiquidateCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgLiquidateCollateral", + value: MsgLiquidateCollateral.encode(value).finish() + }; + }, + setLiquidationFee(value: MsgSetLiquidationFee) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetLiquidationFee", + value: MsgSetLiquidationFee.encode(value).finish() + }; + }, + setInterestFee(value: MsgSetInterestFee) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetInterestFee", + value: MsgSetInterestFee.encode(value).finish() + }; + }, + createRewardScheme(value: MsgCreateRewardScheme) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgCreateRewardScheme", + value: MsgCreateRewardScheme.encode(value).finish() + }; + }, + updateRewardScheme(value: MsgUpdateRewardScheme) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRewardScheme", + value: MsgUpdateRewardScheme.encode(value).finish() + }; + }, + claimRewards(value: MsgClaimRewards) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgClaimRewards", + value: MsgClaimRewards.encode(value).finish() + }; + }, + setStablecoinInterestRate(value: MsgSetStablecoinInterestRate) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRate", + value: MsgSetStablecoinInterestRate.encode(value).finish() + }; + }, + setStablecoinMintCap(value: MsgSetStablecoinMintCap) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinMintCap", + value: MsgSetStablecoinMintCap.encode(value).finish() + }; + }, + mintStablecoin(value: MsgMintStablecoin) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgMintStablecoin", + value: MsgMintStablecoin.encode(value).finish() + }; + }, + returnStablecoin(value: MsgReturnStablecoin) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgReturnStablecoin", + value: MsgReturnStablecoin.encode(value).finish() + }; + }, + setCompleteLiquidationThreshold(value: MsgSetCompleteLiquidationThreshold) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThreshold", + value: MsgSetCompleteLiquidationThreshold.encode(value).finish() + }; + }, + setMinimumCloseFactor(value: MsgSetMinimumCloseFactor) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactor", + value: MsgSetMinimumCloseFactor.encode(value).finish() + }; + }, + setSmallLiquidationSize(value: MsgSetSmallLiquidationSize) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSize", + value: MsgSetSmallLiquidationSize.encode(value).finish() + }; + }, + setStalePriceGracePeriod(value: MsgSetStalePriceGracePeriod) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriod", + value: MsgSetStalePriceGracePeriod.encode(value).finish() + }; + }, + setCdpPaused(value: MsgSetCdpPaused) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCdpPaused", + value: MsgSetCdpPaused.encode(value).finish() + }; + }, + convertTokenInCdpToGroupTokens(value: MsgConvertTokenInCdpToGroupTokens) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokens", + value: MsgConvertTokenInCdpToGroupTokens.encode(value).finish() + }; + }, + addEModeCategory(value: MsgAddEModeCategory) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddEModeCategory", + value: MsgAddEModeCategory.encode(value).finish() + }; + }, + updateEModeCategory(value: MsgUpdateEModeCategory) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateEModeCategory", + value: MsgUpdateEModeCategory.encode(value).finish() + }; + }, + setAccountEMode(value: MsgSetAccountEMode) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetAccountEMode", + value: MsgSetAccountEMode.encode(value).finish() + }; + }, + removeAccountEMode(value: MsgRemoveAccountEMode) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveAccountEMode", + value: MsgRemoveAccountEMode.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + addRateStrategy(value: MsgAddRateStrategy) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddRateStrategy", + value + }; + }, + removeRateStrategy(value: MsgRemoveRateStrategy) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveRateStrategy", + value + }; + }, + addAsset(value: MsgAddAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddAsset", + value + }; + }, + updateRateStrategy(value: MsgUpdateRateStrategy) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRateStrategy", + value + }; + }, + updateAsset(value: MsgUpdateAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateAsset", + value + }; + }, + supplyAsset(value: MsgSupplyAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAsset", + value + }; + }, + withdrawAsset(value: MsgWithdrawAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgWithdrawAsset", + value + }; + }, + lockCollateral(value: MsgLockCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgLockCollateral", + value + }; + }, + unlockCollateral(value: MsgUnlockCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateral", + value + }; + }, + borrowAsset(value: MsgBorrowAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgBorrowAsset", + value + }; + }, + repayAsset(value: MsgRepayAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRepayAsset", + value + }; + }, + supplyAssetAndLockCollateral(value: MsgSupplyAssetAndLockCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateral", + value + }; + }, + unlockCollateralAndWithdrawAsset(value: MsgUnlockCollateralAndWithdrawAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAsset", + value + }; + }, + liquidateCollateral(value: MsgLiquidateCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgLiquidateCollateral", + value + }; + }, + setLiquidationFee(value: MsgSetLiquidationFee) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetLiquidationFee", + value + }; + }, + setInterestFee(value: MsgSetInterestFee) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetInterestFee", + value + }; + }, + createRewardScheme(value: MsgCreateRewardScheme) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgCreateRewardScheme", + value + }; + }, + updateRewardScheme(value: MsgUpdateRewardScheme) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRewardScheme", + value + }; + }, + claimRewards(value: MsgClaimRewards) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgClaimRewards", + value + }; + }, + setStablecoinInterestRate(value: MsgSetStablecoinInterestRate) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRate", + value + }; + }, + setStablecoinMintCap(value: MsgSetStablecoinMintCap) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinMintCap", + value + }; + }, + mintStablecoin(value: MsgMintStablecoin) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgMintStablecoin", + value + }; + }, + returnStablecoin(value: MsgReturnStablecoin) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgReturnStablecoin", + value + }; + }, + setCompleteLiquidationThreshold(value: MsgSetCompleteLiquidationThreshold) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThreshold", + value + }; + }, + setMinimumCloseFactor(value: MsgSetMinimumCloseFactor) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactor", + value + }; + }, + setSmallLiquidationSize(value: MsgSetSmallLiquidationSize) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSize", + value + }; + }, + setStalePriceGracePeriod(value: MsgSetStalePriceGracePeriod) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriod", + value + }; + }, + setCdpPaused(value: MsgSetCdpPaused) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCdpPaused", + value + }; + }, + convertTokenInCdpToGroupTokens(value: MsgConvertTokenInCdpToGroupTokens) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokens", + value + }; + }, + addEModeCategory(value: MsgAddEModeCategory) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddEModeCategory", + value + }; + }, + updateEModeCategory(value: MsgUpdateEModeCategory) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateEModeCategory", + value + }; + }, + setAccountEMode(value: MsgSetAccountEMode) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetAccountEMode", + value + }; + }, + removeAccountEMode(value: MsgRemoveAccountEMode) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveAccountEMode", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + addRateStrategy(value: MsgAddRateStrategy) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddRateStrategy", + value: MsgAddRateStrategy.fromPartial(value) + }; + }, + removeRateStrategy(value: MsgRemoveRateStrategy) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveRateStrategy", + value: MsgRemoveRateStrategy.fromPartial(value) + }; + }, + addAsset(value: MsgAddAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddAsset", + value: MsgAddAsset.fromPartial(value) + }; + }, + updateRateStrategy(value: MsgUpdateRateStrategy) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRateStrategy", + value: MsgUpdateRateStrategy.fromPartial(value) + }; + }, + updateAsset(value: MsgUpdateAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateAsset", + value: MsgUpdateAsset.fromPartial(value) + }; + }, + supplyAsset(value: MsgSupplyAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAsset", + value: MsgSupplyAsset.fromPartial(value) + }; + }, + withdrawAsset(value: MsgWithdrawAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgWithdrawAsset", + value: MsgWithdrawAsset.fromPartial(value) + }; + }, + lockCollateral(value: MsgLockCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgLockCollateral", + value: MsgLockCollateral.fromPartial(value) + }; + }, + unlockCollateral(value: MsgUnlockCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateral", + value: MsgUnlockCollateral.fromPartial(value) + }; + }, + borrowAsset(value: MsgBorrowAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgBorrowAsset", + value: MsgBorrowAsset.fromPartial(value) + }; + }, + repayAsset(value: MsgRepayAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRepayAsset", + value: MsgRepayAsset.fromPartial(value) + }; + }, + supplyAssetAndLockCollateral(value: MsgSupplyAssetAndLockCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateral", + value: MsgSupplyAssetAndLockCollateral.fromPartial(value) + }; + }, + unlockCollateralAndWithdrawAsset(value: MsgUnlockCollateralAndWithdrawAsset) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAsset", + value: MsgUnlockCollateralAndWithdrawAsset.fromPartial(value) + }; + }, + liquidateCollateral(value: MsgLiquidateCollateral) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgLiquidateCollateral", + value: MsgLiquidateCollateral.fromPartial(value) + }; + }, + setLiquidationFee(value: MsgSetLiquidationFee) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetLiquidationFee", + value: MsgSetLiquidationFee.fromPartial(value) + }; + }, + setInterestFee(value: MsgSetInterestFee) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetInterestFee", + value: MsgSetInterestFee.fromPartial(value) + }; + }, + createRewardScheme(value: MsgCreateRewardScheme) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgCreateRewardScheme", + value: MsgCreateRewardScheme.fromPartial(value) + }; + }, + updateRewardScheme(value: MsgUpdateRewardScheme) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRewardScheme", + value: MsgUpdateRewardScheme.fromPartial(value) + }; + }, + claimRewards(value: MsgClaimRewards) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgClaimRewards", + value: MsgClaimRewards.fromPartial(value) + }; + }, + setStablecoinInterestRate(value: MsgSetStablecoinInterestRate) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRate", + value: MsgSetStablecoinInterestRate.fromPartial(value) + }; + }, + setStablecoinMintCap(value: MsgSetStablecoinMintCap) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinMintCap", + value: MsgSetStablecoinMintCap.fromPartial(value) + }; + }, + mintStablecoin(value: MsgMintStablecoin) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgMintStablecoin", + value: MsgMintStablecoin.fromPartial(value) + }; + }, + returnStablecoin(value: MsgReturnStablecoin) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgReturnStablecoin", + value: MsgReturnStablecoin.fromPartial(value) + }; + }, + setCompleteLiquidationThreshold(value: MsgSetCompleteLiquidationThreshold) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThreshold", + value: MsgSetCompleteLiquidationThreshold.fromPartial(value) + }; + }, + setMinimumCloseFactor(value: MsgSetMinimumCloseFactor) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactor", + value: MsgSetMinimumCloseFactor.fromPartial(value) + }; + }, + setSmallLiquidationSize(value: MsgSetSmallLiquidationSize) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSize", + value: MsgSetSmallLiquidationSize.fromPartial(value) + }; + }, + setStalePriceGracePeriod(value: MsgSetStalePriceGracePeriod) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriod", + value: MsgSetStalePriceGracePeriod.fromPartial(value) + }; + }, + setCdpPaused(value: MsgSetCdpPaused) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCdpPaused", + value: MsgSetCdpPaused.fromPartial(value) + }; + }, + convertTokenInCdpToGroupTokens(value: MsgConvertTokenInCdpToGroupTokens) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokens", + value: MsgConvertTokenInCdpToGroupTokens.fromPartial(value) + }; + }, + addEModeCategory(value: MsgAddEModeCategory) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddEModeCategory", + value: MsgAddEModeCategory.fromPartial(value) + }; + }, + updateEModeCategory(value: MsgUpdateEModeCategory) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateEModeCategory", + value: MsgUpdateEModeCategory.fromPartial(value) + }; + }, + setAccountEMode(value: MsgSetAccountEMode) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetAccountEMode", + value: MsgSetAccountEMode.fromPartial(value) + }; + }, + removeAccountEMode(value: MsgRemoveAccountEMode) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveAccountEMode", + value: MsgRemoveAccountEMode.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.rpc.msg.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.rpc.msg.ts new file mode 100644 index 000000000..c1f7308e9 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.rpc.msg.ts @@ -0,0 +1,256 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgAddRateStrategy, MsgAddRateStrategyResponse, MsgRemoveRateStrategy, MsgRemoveRateStrategyResponse, MsgAddAsset, MsgAddAssetResponse, MsgUpdateRateStrategy, MsgUpdateRateStrategyResponse, MsgUpdateAsset, MsgUpdateAssetResponse, MsgSupplyAsset, MsgSupplyAssetResponse, MsgWithdrawAsset, MsgWithdrawAssetResponse, MsgLockCollateral, MsgLockCollateralResponse, MsgUnlockCollateral, MsgUnlockCollateralResponse, MsgBorrowAsset, MsgBorrowAssetResponse, MsgRepayAsset, MsgRepayAssetResponse, MsgSupplyAssetAndLockCollateral, MsgSupplyAssetAndLockCollateralResponse, MsgUnlockCollateralAndWithdrawAsset, MsgUnlockCollateralAndWithdrawAssetResponse, MsgLiquidateCollateral, MsgLiquidateCollateralResponse, MsgSetLiquidationFee, MsgSetLiquidationFeeResponse, MsgSetInterestFee, MsgSetInterestFeeResponse, MsgCreateRewardScheme, MsgCreateRewardSchemeResponse, MsgUpdateRewardScheme, MsgUpdateRewardSchemeResponse, MsgClaimRewards, MsgClaimRewardsResponse, MsgSetStablecoinInterestRate, MsgSetStablecoinInterestRateResponse, MsgSetStablecoinMintCap, MsgSetStablecoinMintCapResponse, MsgMintStablecoin, MsgMintStablecoinResponse, MsgReturnStablecoin, MsgReturnStablecoinResponse, MsgSetCompleteLiquidationThreshold, MsgSetCompleteLiquidationThresholdResponse, MsgSetMinimumCloseFactor, MsgSetMinimumCloseFactorResponse, MsgSetSmallLiquidationSize, MsgSetSmallLiquidationSizeResponse, MsgSetStalePriceGracePeriod, MsgSetStalePriceGracePeriodResponse, MsgSetCdpPaused, MsgSetCdpPausedResponse, MsgConvertTokenInCdpToGroupTokens, MsgConvertTokenInCdpToGroupTokensResponse, MsgAddEModeCategory, MsgAddEModeCategoryResponse, MsgUpdateEModeCategory, MsgUpdateEModeCategoryResponse, MsgSetAccountEMode, MsgSetAccountEModeResponse, MsgRemoveAccountEMode, MsgRemoveAccountEModeResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + addRateStrategy(request: MsgAddRateStrategy): Promise; + removeRateStrategy(request: MsgRemoveRateStrategy): Promise; + addAsset(request: MsgAddAsset): Promise; + updateRateStrategy(request: MsgUpdateRateStrategy): Promise; + updateAsset(request: MsgUpdateAsset): Promise; + supplyAsset(request: MsgSupplyAsset): Promise; + withdrawAsset(request: MsgWithdrawAsset): Promise; + lockCollateral(request: MsgLockCollateral): Promise; + unlockCollateral(request: MsgUnlockCollateral): Promise; + borrowAsset(request: MsgBorrowAsset): Promise; + repayAsset(request: MsgRepayAsset): Promise; + supplyAssetAndLockCollateral(request: MsgSupplyAssetAndLockCollateral): Promise; + unlockCollateralAndWithdrawAsset(request: MsgUnlockCollateralAndWithdrawAsset): Promise; + liquidateCollateral(request: MsgLiquidateCollateral): Promise; + setLiquidationFee(request: MsgSetLiquidationFee): Promise; + setInterestFee(request: MsgSetInterestFee): Promise; + createRewardScheme(request: MsgCreateRewardScheme): Promise; + updateRewardScheme(request: MsgUpdateRewardScheme): Promise; + claimRewards(request: MsgClaimRewards): Promise; + setStablecoinInterestRate(request: MsgSetStablecoinInterestRate): Promise; + setStablecoinMintCap(request: MsgSetStablecoinMintCap): Promise; + mintStablecoin(request: MsgMintStablecoin): Promise; + returnStablecoin(request: MsgReturnStablecoin): Promise; + setCompleteLiquidationThreshold(request: MsgSetCompleteLiquidationThreshold): Promise; + setMinimumCloseFactor(request: MsgSetMinimumCloseFactor): Promise; + setSmallLiquidationSize(request: MsgSetSmallLiquidationSize): Promise; + setStalePriceGracePeriod(request: MsgSetStalePriceGracePeriod): Promise; + setCdpPaused(request: MsgSetCdpPaused): Promise; + convertTokenInCdpToGroupTokens(request: MsgConvertTokenInCdpToGroupTokens): Promise; + addEModeCategory(request: MsgAddEModeCategory): Promise; + updateEModeCategory(request: MsgUpdateEModeCategory): Promise; + setAccountEMode(request: MsgSetAccountEMode): Promise; + removeAccountEMode(request: MsgRemoveAccountEMode): Promise; + /** + * UpdateParams defines a governance operation for updating the module + * parameters. The authority is hard-coded to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.addRateStrategy = this.addRateStrategy.bind(this); + this.removeRateStrategy = this.removeRateStrategy.bind(this); + this.addAsset = this.addAsset.bind(this); + this.updateRateStrategy = this.updateRateStrategy.bind(this); + this.updateAsset = this.updateAsset.bind(this); + this.supplyAsset = this.supplyAsset.bind(this); + this.withdrawAsset = this.withdrawAsset.bind(this); + this.lockCollateral = this.lockCollateral.bind(this); + this.unlockCollateral = this.unlockCollateral.bind(this); + this.borrowAsset = this.borrowAsset.bind(this); + this.repayAsset = this.repayAsset.bind(this); + this.supplyAssetAndLockCollateral = this.supplyAssetAndLockCollateral.bind(this); + this.unlockCollateralAndWithdrawAsset = this.unlockCollateralAndWithdrawAsset.bind(this); + this.liquidateCollateral = this.liquidateCollateral.bind(this); + this.setLiquidationFee = this.setLiquidationFee.bind(this); + this.setInterestFee = this.setInterestFee.bind(this); + this.createRewardScheme = this.createRewardScheme.bind(this); + this.updateRewardScheme = this.updateRewardScheme.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.setStablecoinInterestRate = this.setStablecoinInterestRate.bind(this); + this.setStablecoinMintCap = this.setStablecoinMintCap.bind(this); + this.mintStablecoin = this.mintStablecoin.bind(this); + this.returnStablecoin = this.returnStablecoin.bind(this); + this.setCompleteLiquidationThreshold = this.setCompleteLiquidationThreshold.bind(this); + this.setMinimumCloseFactor = this.setMinimumCloseFactor.bind(this); + this.setSmallLiquidationSize = this.setSmallLiquidationSize.bind(this); + this.setStalePriceGracePeriod = this.setStalePriceGracePeriod.bind(this); + this.setCdpPaused = this.setCdpPaused.bind(this); + this.convertTokenInCdpToGroupTokens = this.convertTokenInCdpToGroupTokens.bind(this); + this.addEModeCategory = this.addEModeCategory.bind(this); + this.updateEModeCategory = this.updateEModeCategory.bind(this); + this.setAccountEMode = this.setAccountEMode.bind(this); + this.removeAccountEMode = this.removeAccountEMode.bind(this); + this.updateParams = this.updateParams.bind(this); + } + addRateStrategy(request: MsgAddRateStrategy, useInterfaces: boolean = true): Promise { + const data = MsgAddRateStrategy.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "AddRateStrategy", data); + return promise.then(data => MsgAddRateStrategyResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + removeRateStrategy(request: MsgRemoveRateStrategy, useInterfaces: boolean = true): Promise { + const data = MsgRemoveRateStrategy.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "RemoveRateStrategy", data); + return promise.then(data => MsgRemoveRateStrategyResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + addAsset(request: MsgAddAsset, useInterfaces: boolean = true): Promise { + const data = MsgAddAsset.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "AddAsset", data); + return promise.then(data => MsgAddAssetResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateRateStrategy(request: MsgUpdateRateStrategy, useInterfaces: boolean = true): Promise { + const data = MsgUpdateRateStrategy.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "UpdateRateStrategy", data); + return promise.then(data => MsgUpdateRateStrategyResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateAsset(request: MsgUpdateAsset, useInterfaces: boolean = true): Promise { + const data = MsgUpdateAsset.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "UpdateAsset", data); + return promise.then(data => MsgUpdateAssetResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + supplyAsset(request: MsgSupplyAsset, useInterfaces: boolean = true): Promise { + const data = MsgSupplyAsset.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SupplyAsset", data); + return promise.then(data => MsgSupplyAssetResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + withdrawAsset(request: MsgWithdrawAsset, useInterfaces: boolean = true): Promise { + const data = MsgWithdrawAsset.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "WithdrawAsset", data); + return promise.then(data => MsgWithdrawAssetResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + lockCollateral(request: MsgLockCollateral, useInterfaces: boolean = true): Promise { + const data = MsgLockCollateral.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "LockCollateral", data); + return promise.then(data => MsgLockCollateralResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + unlockCollateral(request: MsgUnlockCollateral, useInterfaces: boolean = true): Promise { + const data = MsgUnlockCollateral.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "UnlockCollateral", data); + return promise.then(data => MsgUnlockCollateralResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + borrowAsset(request: MsgBorrowAsset, useInterfaces: boolean = true): Promise { + const data = MsgBorrowAsset.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "BorrowAsset", data); + return promise.then(data => MsgBorrowAssetResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + repayAsset(request: MsgRepayAsset, useInterfaces: boolean = true): Promise { + const data = MsgRepayAsset.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "RepayAsset", data); + return promise.then(data => MsgRepayAssetResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + supplyAssetAndLockCollateral(request: MsgSupplyAssetAndLockCollateral, useInterfaces: boolean = true): Promise { + const data = MsgSupplyAssetAndLockCollateral.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SupplyAssetAndLockCollateral", data); + return promise.then(data => MsgSupplyAssetAndLockCollateralResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + unlockCollateralAndWithdrawAsset(request: MsgUnlockCollateralAndWithdrawAsset, useInterfaces: boolean = true): Promise { + const data = MsgUnlockCollateralAndWithdrawAsset.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "UnlockCollateralAndWithdrawAsset", data); + return promise.then(data => MsgUnlockCollateralAndWithdrawAssetResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + liquidateCollateral(request: MsgLiquidateCollateral, useInterfaces: boolean = true): Promise { + const data = MsgLiquidateCollateral.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "LiquidateCollateral", data); + return promise.then(data => MsgLiquidateCollateralResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setLiquidationFee(request: MsgSetLiquidationFee, useInterfaces: boolean = true): Promise { + const data = MsgSetLiquidationFee.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SetLiquidationFee", data); + return promise.then(data => MsgSetLiquidationFeeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setInterestFee(request: MsgSetInterestFee, useInterfaces: boolean = true): Promise { + const data = MsgSetInterestFee.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SetInterestFee", data); + return promise.then(data => MsgSetInterestFeeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + createRewardScheme(request: MsgCreateRewardScheme, useInterfaces: boolean = true): Promise { + const data = MsgCreateRewardScheme.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "CreateRewardScheme", data); + return promise.then(data => MsgCreateRewardSchemeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateRewardScheme(request: MsgUpdateRewardScheme, useInterfaces: boolean = true): Promise { + const data = MsgUpdateRewardScheme.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "UpdateRewardScheme", data); + return promise.then(data => MsgUpdateRewardSchemeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + claimRewards(request: MsgClaimRewards, useInterfaces: boolean = true): Promise { + const data = MsgClaimRewards.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "ClaimRewards", data); + return promise.then(data => MsgClaimRewardsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setStablecoinInterestRate(request: MsgSetStablecoinInterestRate, useInterfaces: boolean = true): Promise { + const data = MsgSetStablecoinInterestRate.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SetStablecoinInterestRate", data); + return promise.then(data => MsgSetStablecoinInterestRateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setStablecoinMintCap(request: MsgSetStablecoinMintCap, useInterfaces: boolean = true): Promise { + const data = MsgSetStablecoinMintCap.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SetStablecoinMintCap", data); + return promise.then(data => MsgSetStablecoinMintCapResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + mintStablecoin(request: MsgMintStablecoin, useInterfaces: boolean = true): Promise { + const data = MsgMintStablecoin.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "MintStablecoin", data); + return promise.then(data => MsgMintStablecoinResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + returnStablecoin(request: MsgReturnStablecoin, useInterfaces: boolean = true): Promise { + const data = MsgReturnStablecoin.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "ReturnStablecoin", data); + return promise.then(data => MsgReturnStablecoinResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setCompleteLiquidationThreshold(request: MsgSetCompleteLiquidationThreshold, useInterfaces: boolean = true): Promise { + const data = MsgSetCompleteLiquidationThreshold.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SetCompleteLiquidationThreshold", data); + return promise.then(data => MsgSetCompleteLiquidationThresholdResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setMinimumCloseFactor(request: MsgSetMinimumCloseFactor, useInterfaces: boolean = true): Promise { + const data = MsgSetMinimumCloseFactor.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SetMinimumCloseFactor", data); + return promise.then(data => MsgSetMinimumCloseFactorResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setSmallLiquidationSize(request: MsgSetSmallLiquidationSize, useInterfaces: boolean = true): Promise { + const data = MsgSetSmallLiquidationSize.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SetSmallLiquidationSize", data); + return promise.then(data => MsgSetSmallLiquidationSizeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setStalePriceGracePeriod(request: MsgSetStalePriceGracePeriod, useInterfaces: boolean = true): Promise { + const data = MsgSetStalePriceGracePeriod.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SetStalePriceGracePeriod", data); + return promise.then(data => MsgSetStalePriceGracePeriodResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setCdpPaused(request: MsgSetCdpPaused, useInterfaces: boolean = true): Promise { + const data = MsgSetCdpPaused.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SetCdpPaused", data); + return promise.then(data => MsgSetCdpPausedResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + convertTokenInCdpToGroupTokens(request: MsgConvertTokenInCdpToGroupTokens, useInterfaces: boolean = true): Promise { + const data = MsgConvertTokenInCdpToGroupTokens.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "ConvertTokenInCdpToGroupTokens", data); + return promise.then(data => MsgConvertTokenInCdpToGroupTokensResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + addEModeCategory(request: MsgAddEModeCategory, useInterfaces: boolean = true): Promise { + const data = MsgAddEModeCategory.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "AddEModeCategory", data); + return promise.then(data => MsgAddEModeCategoryResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateEModeCategory(request: MsgUpdateEModeCategory, useInterfaces: boolean = true): Promise { + const data = MsgUpdateEModeCategory.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "UpdateEModeCategory", data); + return promise.then(data => MsgUpdateEModeCategoryResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setAccountEMode(request: MsgSetAccountEMode, useInterfaces: boolean = true): Promise { + const data = MsgSetAccountEMode.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "SetAccountEMode", data); + return promise.then(data => MsgSetAccountEModeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + removeAccountEMode(request: MsgRemoveAccountEMode, useInterfaces: boolean = true): Promise { + const data = MsgRemoveAccountEMode.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "RemoveAccountEMode", data); + return promise.then(data => MsgRemoveAccountEModeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateParams(request: MsgUpdateParams, useInterfaces: boolean = true): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("Switcheo.carbon.cdp.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.ts b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.ts new file mode 100644 index 000000000..b3ad73700 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/carbon/cdp/tx.ts @@ -0,0 +1,6093 @@ +//@ts-nocheck +import { RateStrategyParams, RateStrategyParamsAmino, RateStrategyParamsSDKType } from "./rate_strategy_params"; +import { AssetParams, AssetParamsAmino, AssetParamsSDKType, UpdateAssetParams, UpdateAssetParamsAmino, UpdateAssetParamsSDKType } from "./asset_params"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { CreateRewardSchemeParams, CreateRewardSchemeParamsAmino, CreateRewardSchemeParamsSDKType, UpdateRewardSchemeParams, UpdateRewardSchemeParamsAmino, UpdateRewardSchemeParamsSDKType } from "./reward_scheme"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { EModeCategory, EModeCategoryAmino, EModeCategorySDKType } from "./e_mode_category"; +import { ParamsToUpdate, ParamsToUpdateAmino, ParamsToUpdateSDKType } from "./params"; +import { StringValue, StringValueAmino, StringValueSDKType, Int64Value, Int64ValueAmino, Int64ValueSDKType, BoolValue, BoolValueAmino, BoolValueSDKType } from "../../../google/protobuf/wrappers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +export interface MsgAddRateStrategy { + creator: string; + rateStrategyParams: RateStrategyParams | undefined; +} +export interface MsgAddRateStrategyProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgAddRateStrategy"; + value: Uint8Array; +} +export interface MsgAddRateStrategyAmino { + creator?: string; + rate_strategy_params?: RateStrategyParamsAmino | undefined; +} +export interface MsgAddRateStrategyAminoMsg { + type: "cdp/AddRateStrategy"; + value: MsgAddRateStrategyAmino; +} +export interface MsgAddRateStrategySDKType { + creator: string; + rate_strategy_params: RateStrategyParamsSDKType | undefined; +} +export interface MsgAddRateStrategyResponse { + rateStrategyParams: RateStrategyParams | undefined; +} +export interface MsgAddRateStrategyResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgAddRateStrategyResponse"; + value: Uint8Array; +} +export interface MsgAddRateStrategyResponseAmino { + rate_strategy_params?: RateStrategyParamsAmino | undefined; +} +export interface MsgAddRateStrategyResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgAddRateStrategyResponse"; + value: MsgAddRateStrategyResponseAmino; +} +export interface MsgAddRateStrategyResponseSDKType { + rate_strategy_params: RateStrategyParamsSDKType | undefined; +} +export interface MsgUpdateRateStrategy { + creator: string; + rateStrategyParams: RateStrategyParams | undefined; +} +export interface MsgUpdateRateStrategyProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRateStrategy"; + value: Uint8Array; +} +export interface MsgUpdateRateStrategyAmino { + creator?: string; + rate_strategy_params?: RateStrategyParamsAmino | undefined; +} +export interface MsgUpdateRateStrategyAminoMsg { + type: "cdp/UpdateRateStrategy"; + value: MsgUpdateRateStrategyAmino; +} +export interface MsgUpdateRateStrategySDKType { + creator: string; + rate_strategy_params: RateStrategyParamsSDKType | undefined; +} +export interface MsgUpdateRateStrategyResponse { + rateStrategyParams: RateStrategyParams | undefined; +} +export interface MsgUpdateRateStrategyResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRateStrategyResponse"; + value: Uint8Array; +} +export interface MsgUpdateRateStrategyResponseAmino { + rate_strategy_params?: RateStrategyParamsAmino | undefined; +} +export interface MsgUpdateRateStrategyResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgUpdateRateStrategyResponse"; + value: MsgUpdateRateStrategyResponseAmino; +} +export interface MsgUpdateRateStrategyResponseSDKType { + rate_strategy_params: RateStrategyParamsSDKType | undefined; +} +export interface MsgRemoveRateStrategy { + creator: string; + name: string; +} +export interface MsgRemoveRateStrategyProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveRateStrategy"; + value: Uint8Array; +} +export interface MsgRemoveRateStrategyAmino { + creator?: string; + name?: string; +} +export interface MsgRemoveRateStrategyAminoMsg { + type: "cdp/RemoveRateStrategy"; + value: MsgRemoveRateStrategyAmino; +} +export interface MsgRemoveRateStrategySDKType { + creator: string; + name: string; +} +export interface MsgRemoveRateStrategyResponse { + name: string; +} +export interface MsgRemoveRateStrategyResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveRateStrategyResponse"; + value: Uint8Array; +} +export interface MsgRemoveRateStrategyResponseAmino { + name?: string; +} +export interface MsgRemoveRateStrategyResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgRemoveRateStrategyResponse"; + value: MsgRemoveRateStrategyResponseAmino; +} +export interface MsgRemoveRateStrategyResponseSDKType { + name: string; +} +export interface MsgAddAsset { + creator: string; + assetParams: AssetParams | undefined; +} +export interface MsgAddAssetProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgAddAsset"; + value: Uint8Array; +} +export interface MsgAddAssetAmino { + creator?: string; + asset_params?: AssetParamsAmino | undefined; +} +export interface MsgAddAssetAminoMsg { + type: "cdp/AddAsset"; + value: MsgAddAssetAmino; +} +export interface MsgAddAssetSDKType { + creator: string; + asset_params: AssetParamsSDKType | undefined; +} +export interface MsgAddAssetResponse { + assetParams: AssetParams | undefined; +} +export interface MsgAddAssetResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgAddAssetResponse"; + value: Uint8Array; +} +export interface MsgAddAssetResponseAmino { + asset_params?: AssetParamsAmino | undefined; +} +export interface MsgAddAssetResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgAddAssetResponse"; + value: MsgAddAssetResponseAmino; +} +export interface MsgAddAssetResponseSDKType { + asset_params: AssetParamsSDKType | undefined; +} +export interface MsgUpdateAsset { + creator: string; + assetParams: UpdateAssetParams | undefined; +} +export interface MsgUpdateAssetProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateAsset"; + value: Uint8Array; +} +export interface MsgUpdateAssetAmino { + creator?: string; + asset_params?: UpdateAssetParamsAmino | undefined; +} +export interface MsgUpdateAssetAminoMsg { + type: "cdp/UpdateAsset"; + value: MsgUpdateAssetAmino; +} +export interface MsgUpdateAssetSDKType { + creator: string; + asset_params: UpdateAssetParamsSDKType | undefined; +} +export interface MsgUpdateAssetResponse { + assetParams: AssetParams | undefined; +} +export interface MsgUpdateAssetResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateAssetResponse"; + value: Uint8Array; +} +export interface MsgUpdateAssetResponseAmino { + asset_params?: AssetParamsAmino | undefined; +} +export interface MsgUpdateAssetResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgUpdateAssetResponse"; + value: MsgUpdateAssetResponseAmino; +} +export interface MsgUpdateAssetResponseSDKType { + asset_params: AssetParamsSDKType | undefined; +} +export interface MsgSupplyAsset { + creator: string; + denom: string; + amount: string; +} +export interface MsgSupplyAssetProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAsset"; + value: Uint8Array; +} +export interface MsgSupplyAssetAmino { + creator?: string; + denom?: string; + amount?: string; +} +export interface MsgSupplyAssetAminoMsg { + type: "cdp/SupplyAsset"; + value: MsgSupplyAssetAmino; +} +export interface MsgSupplyAssetSDKType { + creator: string; + denom: string; + amount: string; +} +export interface MsgSupplyAssetResponse {} +export interface MsgSupplyAssetResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetResponse"; + value: Uint8Array; +} +export interface MsgSupplyAssetResponseAmino {} +export interface MsgSupplyAssetResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSupplyAssetResponse"; + value: MsgSupplyAssetResponseAmino; +} +export interface MsgSupplyAssetResponseSDKType {} +export interface MsgWithdrawAsset { + creator: string; + cibtDenom: string; + amount: string; +} +export interface MsgWithdrawAssetProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgWithdrawAsset"; + value: Uint8Array; +} +export interface MsgWithdrawAssetAmino { + creator?: string; + cibt_denom?: string; + amount?: string; +} +export interface MsgWithdrawAssetAminoMsg { + type: "cdp/WithdrawAsset"; + value: MsgWithdrawAssetAmino; +} +export interface MsgWithdrawAssetSDKType { + creator: string; + cibt_denom: string; + amount: string; +} +export interface MsgWithdrawAssetResponse {} +export interface MsgWithdrawAssetResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgWithdrawAssetResponse"; + value: Uint8Array; +} +export interface MsgWithdrawAssetResponseAmino {} +export interface MsgWithdrawAssetResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgWithdrawAssetResponse"; + value: MsgWithdrawAssetResponseAmino; +} +export interface MsgWithdrawAssetResponseSDKType {} +export interface MsgLockCollateral { + creator: string; + cibtDenom: string; + amount: string; +} +export interface MsgLockCollateralProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgLockCollateral"; + value: Uint8Array; +} +export interface MsgLockCollateralAmino { + creator?: string; + cibt_denom?: string; + amount?: string; +} +export interface MsgLockCollateralAminoMsg { + type: "cdp/LockCollateral"; + value: MsgLockCollateralAmino; +} +export interface MsgLockCollateralSDKType { + creator: string; + cibt_denom: string; + amount: string; +} +export interface MsgLockCollateralResponse {} +export interface MsgLockCollateralResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgLockCollateralResponse"; + value: Uint8Array; +} +export interface MsgLockCollateralResponseAmino {} +export interface MsgLockCollateralResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgLockCollateralResponse"; + value: MsgLockCollateralResponseAmino; +} +export interface MsgLockCollateralResponseSDKType {} +export interface MsgUnlockCollateral { + creator: string; + cibtDenom: string; + amount: string; +} +export interface MsgUnlockCollateralProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateral"; + value: Uint8Array; +} +export interface MsgUnlockCollateralAmino { + creator?: string; + cibt_denom?: string; + amount?: string; +} +export interface MsgUnlockCollateralAminoMsg { + type: "cdp/UnlockCollateral"; + value: MsgUnlockCollateralAmino; +} +export interface MsgUnlockCollateralSDKType { + creator: string; + cibt_denom: string; + amount: string; +} +export interface MsgUnlockCollateralResponse {} +export interface MsgUnlockCollateralResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralResponse"; + value: Uint8Array; +} +export interface MsgUnlockCollateralResponseAmino {} +export interface MsgUnlockCollateralResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgUnlockCollateralResponse"; + value: MsgUnlockCollateralResponseAmino; +} +export interface MsgUnlockCollateralResponseSDKType {} +export interface MsgBorrowAsset { + creator: string; + denom: string; + amount: string; +} +export interface MsgBorrowAssetProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgBorrowAsset"; + value: Uint8Array; +} +export interface MsgBorrowAssetAmino { + creator?: string; + denom?: string; + amount?: string; +} +export interface MsgBorrowAssetAminoMsg { + type: "cdp/BorrowAsset"; + value: MsgBorrowAssetAmino; +} +export interface MsgBorrowAssetSDKType { + creator: string; + denom: string; + amount: string; +} +export interface MsgBorrowAssetResponse {} +export interface MsgBorrowAssetResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgBorrowAssetResponse"; + value: Uint8Array; +} +export interface MsgBorrowAssetResponseAmino {} +export interface MsgBorrowAssetResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgBorrowAssetResponse"; + value: MsgBorrowAssetResponseAmino; +} +export interface MsgBorrowAssetResponseSDKType {} +export interface MsgRepayAsset { + creator: string; + denom: string; + amount: string; + debtor: string; + fromCollateral: boolean; +} +export interface MsgRepayAssetProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgRepayAsset"; + value: Uint8Array; +} +export interface MsgRepayAssetAmino { + creator?: string; + denom?: string; + amount?: string; + debtor?: string; + from_collateral?: boolean; +} +export interface MsgRepayAssetAminoMsg { + type: "cdp/RepayAsset"; + value: MsgRepayAssetAmino; +} +export interface MsgRepayAssetSDKType { + creator: string; + denom: string; + amount: string; + debtor: string; + from_collateral: boolean; +} +export interface MsgRepayAssetResponse {} +export interface MsgRepayAssetResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgRepayAssetResponse"; + value: Uint8Array; +} +export interface MsgRepayAssetResponseAmino {} +export interface MsgRepayAssetResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgRepayAssetResponse"; + value: MsgRepayAssetResponseAmino; +} +export interface MsgRepayAssetResponseSDKType {} +export interface MsgSupplyAssetAndLockCollateral { + creator: string; + denom: string; + supplyAmount: string; + lockAmount: string; +} +export interface MsgSupplyAssetAndLockCollateralProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateral"; + value: Uint8Array; +} +export interface MsgSupplyAssetAndLockCollateralAmino { + creator?: string; + denom?: string; + supply_amount?: string; + lock_amount?: string; +} +export interface MsgSupplyAssetAndLockCollateralAminoMsg { + type: "cdp/SupplyAssetAndLockCollateral"; + value: MsgSupplyAssetAndLockCollateralAmino; +} +export interface MsgSupplyAssetAndLockCollateralSDKType { + creator: string; + denom: string; + supply_amount: string; + lock_amount: string; +} +export interface MsgSupplyAssetAndLockCollateralResponse {} +export interface MsgSupplyAssetAndLockCollateralResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateralResponse"; + value: Uint8Array; +} +export interface MsgSupplyAssetAndLockCollateralResponseAmino {} +export interface MsgSupplyAssetAndLockCollateralResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateralResponse"; + value: MsgSupplyAssetAndLockCollateralResponseAmino; +} +export interface MsgSupplyAssetAndLockCollateralResponseSDKType {} +export interface MsgUnlockCollateralAndWithdrawAsset { + creator: string; + cibtDenom: string; + unlockAmount: string; + withdrawAmount: string; +} +export interface MsgUnlockCollateralAndWithdrawAssetProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAsset"; + value: Uint8Array; +} +export interface MsgUnlockCollateralAndWithdrawAssetAmino { + creator?: string; + cibt_denom?: string; + unlock_amount?: string; + withdraw_amount?: string; +} +export interface MsgUnlockCollateralAndWithdrawAssetAminoMsg { + type: "cdp/UnlockCollateralAndWithdrawAsset"; + value: MsgUnlockCollateralAndWithdrawAssetAmino; +} +export interface MsgUnlockCollateralAndWithdrawAssetSDKType { + creator: string; + cibt_denom: string; + unlock_amount: string; + withdraw_amount: string; +} +export interface MsgUnlockCollateralAndWithdrawAssetResponse {} +export interface MsgUnlockCollateralAndWithdrawAssetResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAssetResponse"; + value: Uint8Array; +} +export interface MsgUnlockCollateralAndWithdrawAssetResponseAmino {} +export interface MsgUnlockCollateralAndWithdrawAssetResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAssetResponse"; + value: MsgUnlockCollateralAndWithdrawAssetResponseAmino; +} +export interface MsgUnlockCollateralAndWithdrawAssetResponseSDKType {} +export interface MsgLiquidateCollateral { + creator: string; + debtor: string; + minCollateral: Coin | undefined; + debt: Coin | undefined; + stableInterest?: Coin | undefined; + debtFromCollateral: boolean; + interestFromCollateral: boolean; +} +export interface MsgLiquidateCollateralProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgLiquidateCollateral"; + value: Uint8Array; +} +export interface MsgLiquidateCollateralAmino { + creator?: string; + debtor?: string; + min_collateral?: CoinAmino | undefined; + debt?: CoinAmino | undefined; + stable_interest?: CoinAmino | undefined; + debt_from_collateral?: boolean; + interest_from_collateral?: boolean; +} +export interface MsgLiquidateCollateralAminoMsg { + type: "cdp/LiquidateCollateral"; + value: MsgLiquidateCollateralAmino; +} +export interface MsgLiquidateCollateralSDKType { + creator: string; + debtor: string; + min_collateral: CoinSDKType | undefined; + debt: CoinSDKType | undefined; + stable_interest?: CoinSDKType | undefined; + debt_from_collateral: boolean; + interest_from_collateral: boolean; +} +export interface MsgLiquidateCollateralResponse {} +export interface MsgLiquidateCollateralResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgLiquidateCollateralResponse"; + value: Uint8Array; +} +export interface MsgLiquidateCollateralResponseAmino {} +export interface MsgLiquidateCollateralResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgLiquidateCollateralResponse"; + value: MsgLiquidateCollateralResponseAmino; +} +export interface MsgLiquidateCollateralResponseSDKType {} +export interface MsgSetLiquidationFee { + creator: string; + liquidationFee: string; +} +export interface MsgSetLiquidationFeeProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetLiquidationFee"; + value: Uint8Array; +} +export interface MsgSetLiquidationFeeAmino { + creator?: string; + liquidation_fee?: string; +} +export interface MsgSetLiquidationFeeAminoMsg { + type: "cdp/SetLiquidationFee"; + value: MsgSetLiquidationFeeAmino; +} +export interface MsgSetLiquidationFeeSDKType { + creator: string; + liquidation_fee: string; +} +export interface MsgSetLiquidationFeeResponse {} +export interface MsgSetLiquidationFeeResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetLiquidationFeeResponse"; + value: Uint8Array; +} +export interface MsgSetLiquidationFeeResponseAmino {} +export interface MsgSetLiquidationFeeResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSetLiquidationFeeResponse"; + value: MsgSetLiquidationFeeResponseAmino; +} +export interface MsgSetLiquidationFeeResponseSDKType {} +export interface MsgSetInterestFee { + creator: string; + interestFee: string; +} +export interface MsgSetInterestFeeProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetInterestFee"; + value: Uint8Array; +} +export interface MsgSetInterestFeeAmino { + creator?: string; + interest_fee?: string; +} +export interface MsgSetInterestFeeAminoMsg { + type: "cdp/SetInterestFee"; + value: MsgSetInterestFeeAmino; +} +export interface MsgSetInterestFeeSDKType { + creator: string; + interest_fee: string; +} +export interface MsgSetInterestFeeResponse {} +export interface MsgSetInterestFeeResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetInterestFeeResponse"; + value: Uint8Array; +} +export interface MsgSetInterestFeeResponseAmino {} +export interface MsgSetInterestFeeResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSetInterestFeeResponse"; + value: MsgSetInterestFeeResponseAmino; +} +export interface MsgSetInterestFeeResponseSDKType {} +export interface MsgSetStablecoinMintCap { + creator: string; + stablecoinMintCap: string; +} +export interface MsgSetStablecoinMintCapProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinMintCap"; + value: Uint8Array; +} +export interface MsgSetStablecoinMintCapAmino { + creator?: string; + stablecoin_mint_cap?: string; +} +export interface MsgSetStablecoinMintCapAminoMsg { + type: "cdp/SetStablecoinMintCap"; + value: MsgSetStablecoinMintCapAmino; +} +export interface MsgSetStablecoinMintCapSDKType { + creator: string; + stablecoin_mint_cap: string; +} +export interface MsgSetStablecoinMintCapResponse {} +export interface MsgSetStablecoinMintCapResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinMintCapResponse"; + value: Uint8Array; +} +export interface MsgSetStablecoinMintCapResponseAmino {} +export interface MsgSetStablecoinMintCapResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSetStablecoinMintCapResponse"; + value: MsgSetStablecoinMintCapResponseAmino; +} +export interface MsgSetStablecoinMintCapResponseSDKType {} +export interface MsgSetStablecoinInterestRate { + creator: string; + stablecoinInterestRate: string; +} +export interface MsgSetStablecoinInterestRateProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRate"; + value: Uint8Array; +} +export interface MsgSetStablecoinInterestRateAmino { + creator?: string; + stablecoin_interest_rate?: string; +} +export interface MsgSetStablecoinInterestRateAminoMsg { + type: "cdp/SetStablecoinInterestRate"; + value: MsgSetStablecoinInterestRateAmino; +} +export interface MsgSetStablecoinInterestRateSDKType { + creator: string; + stablecoin_interest_rate: string; +} +export interface MsgSetStablecoinInterestRateResponse {} +export interface MsgSetStablecoinInterestRateResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRateResponse"; + value: Uint8Array; +} +export interface MsgSetStablecoinInterestRateResponseAmino {} +export interface MsgSetStablecoinInterestRateResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRateResponse"; + value: MsgSetStablecoinInterestRateResponseAmino; +} +export interface MsgSetStablecoinInterestRateResponseSDKType {} +export interface MsgMintStablecoin { + creator: string; + amount: string; +} +export interface MsgMintStablecoinProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgMintStablecoin"; + value: Uint8Array; +} +export interface MsgMintStablecoinAmino { + creator?: string; + amount?: string; +} +export interface MsgMintStablecoinAminoMsg { + type: "cdp/MintStablecoin"; + value: MsgMintStablecoinAmino; +} +export interface MsgMintStablecoinSDKType { + creator: string; + amount: string; +} +export interface MsgMintStablecoinResponse {} +export interface MsgMintStablecoinResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgMintStablecoinResponse"; + value: Uint8Array; +} +export interface MsgMintStablecoinResponseAmino {} +export interface MsgMintStablecoinResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgMintStablecoinResponse"; + value: MsgMintStablecoinResponseAmino; +} +export interface MsgMintStablecoinResponseSDKType {} +export interface MsgReturnStablecoin { + creator: string; + principal: Coin | undefined; + interest: Coin | undefined; + debtor: string; + principalFromCollateral: boolean; + interestFromCollateral: boolean; +} +export interface MsgReturnStablecoinProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgReturnStablecoin"; + value: Uint8Array; +} +export interface MsgReturnStablecoinAmino { + creator?: string; + principal?: CoinAmino | undefined; + interest?: CoinAmino | undefined; + debtor?: string; + principal_from_collateral?: boolean; + interest_from_collateral?: boolean; +} +export interface MsgReturnStablecoinAminoMsg { + type: "cdp/ReturnStablecoin"; + value: MsgReturnStablecoinAmino; +} +export interface MsgReturnStablecoinSDKType { + creator: string; + principal: CoinSDKType | undefined; + interest: CoinSDKType | undefined; + debtor: string; + principal_from_collateral: boolean; + interest_from_collateral: boolean; +} +export interface MsgReturnStablecoinResponse {} +export interface MsgReturnStablecoinResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgReturnStablecoinResponse"; + value: Uint8Array; +} +export interface MsgReturnStablecoinResponseAmino {} +export interface MsgReturnStablecoinResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgReturnStablecoinResponse"; + value: MsgReturnStablecoinResponseAmino; +} +export interface MsgReturnStablecoinResponseSDKType {} +export interface MsgSetCompleteLiquidationThreshold { + creator: string; + completeLiquidationThreshold: string; +} +export interface MsgSetCompleteLiquidationThresholdProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThreshold"; + value: Uint8Array; +} +export interface MsgSetCompleteLiquidationThresholdAmino { + creator?: string; + complete_liquidation_threshold?: string; +} +export interface MsgSetCompleteLiquidationThresholdAminoMsg { + type: "cdp/SetCompleteLiquidationThreshold"; + value: MsgSetCompleteLiquidationThresholdAmino; +} +export interface MsgSetCompleteLiquidationThresholdSDKType { + creator: string; + complete_liquidation_threshold: string; +} +export interface MsgSetCompleteLiquidationThresholdResponse {} +export interface MsgSetCompleteLiquidationThresholdResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThresholdResponse"; + value: Uint8Array; +} +export interface MsgSetCompleteLiquidationThresholdResponseAmino {} +export interface MsgSetCompleteLiquidationThresholdResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThresholdResponse"; + value: MsgSetCompleteLiquidationThresholdResponseAmino; +} +export interface MsgSetCompleteLiquidationThresholdResponseSDKType {} +export interface MsgSetMinimumCloseFactor { + creator: string; + minimumCloseFactor: string; +} +export interface MsgSetMinimumCloseFactorProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactor"; + value: Uint8Array; +} +export interface MsgSetMinimumCloseFactorAmino { + creator?: string; + minimum_close_factor?: string; +} +export interface MsgSetMinimumCloseFactorAminoMsg { + type: "cdp/SetMinimumCloseFactor"; + value: MsgSetMinimumCloseFactorAmino; +} +export interface MsgSetMinimumCloseFactorSDKType { + creator: string; + minimum_close_factor: string; +} +export interface MsgSetMinimumCloseFactorResponse {} +export interface MsgSetMinimumCloseFactorResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactorResponse"; + value: Uint8Array; +} +export interface MsgSetMinimumCloseFactorResponseAmino {} +export interface MsgSetMinimumCloseFactorResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactorResponse"; + value: MsgSetMinimumCloseFactorResponseAmino; +} +export interface MsgSetMinimumCloseFactorResponseSDKType {} +export interface MsgSetSmallLiquidationSize { + creator: string; + smallLiquidationSize: string; +} +export interface MsgSetSmallLiquidationSizeProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSize"; + value: Uint8Array; +} +export interface MsgSetSmallLiquidationSizeAmino { + creator?: string; + small_liquidation_size?: string; +} +export interface MsgSetSmallLiquidationSizeAminoMsg { + type: "cdp/SetSmallLiquidationSize"; + value: MsgSetSmallLiquidationSizeAmino; +} +export interface MsgSetSmallLiquidationSizeSDKType { + creator: string; + small_liquidation_size: string; +} +export interface MsgSetSmallLiquidationSizeResponse {} +export interface MsgSetSmallLiquidationSizeResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSizeResponse"; + value: Uint8Array; +} +export interface MsgSetSmallLiquidationSizeResponseAmino {} +export interface MsgSetSmallLiquidationSizeResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSizeResponse"; + value: MsgSetSmallLiquidationSizeResponseAmino; +} +export interface MsgSetSmallLiquidationSizeResponseSDKType {} +export interface MsgCreateRewardScheme { + creator: string; + createRewardSchemeParams: CreateRewardSchemeParams | undefined; +} +export interface MsgCreateRewardSchemeProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgCreateRewardScheme"; + value: Uint8Array; +} +export interface MsgCreateRewardSchemeAmino { + creator?: string; + create_reward_scheme_params?: CreateRewardSchemeParamsAmino | undefined; +} +export interface MsgCreateRewardSchemeAminoMsg { + type: "cdp/CreateRewardScheme"; + value: MsgCreateRewardSchemeAmino; +} +export interface MsgCreateRewardSchemeSDKType { + creator: string; + create_reward_scheme_params: CreateRewardSchemeParamsSDKType | undefined; +} +export interface MsgCreateRewardSchemeResponse {} +export interface MsgCreateRewardSchemeResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgCreateRewardSchemeResponse"; + value: Uint8Array; +} +export interface MsgCreateRewardSchemeResponseAmino {} +export interface MsgCreateRewardSchemeResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgCreateRewardSchemeResponse"; + value: MsgCreateRewardSchemeResponseAmino; +} +export interface MsgCreateRewardSchemeResponseSDKType {} +export interface MsgUpdateRewardScheme { + updater: string; + updateRewardSchemeParams: UpdateRewardSchemeParams | undefined; +} +export interface MsgUpdateRewardSchemeProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRewardScheme"; + value: Uint8Array; +} +export interface MsgUpdateRewardSchemeAmino { + updater?: string; + update_reward_scheme_params?: UpdateRewardSchemeParamsAmino | undefined; +} +export interface MsgUpdateRewardSchemeAminoMsg { + type: "cdp/UpdateRewardScheme"; + value: MsgUpdateRewardSchemeAmino; +} +export interface MsgUpdateRewardSchemeSDKType { + updater: string; + update_reward_scheme_params: UpdateRewardSchemeParamsSDKType | undefined; +} +export interface MsgUpdateRewardSchemeResponse {} +export interface MsgUpdateRewardSchemeResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRewardSchemeResponse"; + value: Uint8Array; +} +export interface MsgUpdateRewardSchemeResponseAmino {} +export interface MsgUpdateRewardSchemeResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgUpdateRewardSchemeResponse"; + value: MsgUpdateRewardSchemeResponseAmino; +} +export interface MsgUpdateRewardSchemeResponseSDKType {} +export interface MsgClaimRewards { + creator: string; +} +export interface MsgClaimRewardsProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgClaimRewards"; + value: Uint8Array; +} +export interface MsgClaimRewardsAmino { + creator?: string; +} +export interface MsgClaimRewardsAminoMsg { + type: "cdp/ClaimRewards"; + value: MsgClaimRewardsAmino; +} +export interface MsgClaimRewardsSDKType { + creator: string; +} +export interface MsgClaimRewardsResponse {} +export interface MsgClaimRewardsResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgClaimRewardsResponse"; + value: Uint8Array; +} +export interface MsgClaimRewardsResponseAmino {} +export interface MsgClaimRewardsResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgClaimRewardsResponse"; + value: MsgClaimRewardsResponseAmino; +} +export interface MsgClaimRewardsResponseSDKType {} +export interface MsgSetStalePriceGracePeriod { + creator: string; + stalePriceGracePeriod: Duration | undefined; +} +export interface MsgSetStalePriceGracePeriodProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriod"; + value: Uint8Array; +} +export interface MsgSetStalePriceGracePeriodAmino { + creator?: string; + stale_price_grace_period?: DurationAmino | undefined; +} +export interface MsgSetStalePriceGracePeriodAminoMsg { + type: "cdp/SetStalePriceGracePeriod"; + value: MsgSetStalePriceGracePeriodAmino; +} +export interface MsgSetStalePriceGracePeriodSDKType { + creator: string; + stale_price_grace_period: DurationSDKType | undefined; +} +export interface MsgSetStalePriceGracePeriodResponse {} +export interface MsgSetStalePriceGracePeriodResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriodResponse"; + value: Uint8Array; +} +export interface MsgSetStalePriceGracePeriodResponseAmino {} +export interface MsgSetStalePriceGracePeriodResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriodResponse"; + value: MsgSetStalePriceGracePeriodResponseAmino; +} +export interface MsgSetStalePriceGracePeriodResponseSDKType {} +export interface MsgSetCdpPaused { + creator: string; + cdpPaused: boolean; +} +export interface MsgSetCdpPausedProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCdpPaused"; + value: Uint8Array; +} +export interface MsgSetCdpPausedAmino { + creator?: string; + cdpPaused?: boolean; +} +export interface MsgSetCdpPausedAminoMsg { + type: "cdp/SetCdpPaused"; + value: MsgSetCdpPausedAmino; +} +export interface MsgSetCdpPausedSDKType { + creator: string; + cdpPaused: boolean; +} +export interface MsgSetCdpPausedResponse {} +export interface MsgSetCdpPausedResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCdpPausedResponse"; + value: Uint8Array; +} +export interface MsgSetCdpPausedResponseAmino {} +export interface MsgSetCdpPausedResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSetCdpPausedResponse"; + value: MsgSetCdpPausedResponseAmino; +} +export interface MsgSetCdpPausedResponseSDKType {} +export interface MsgConvertTokenInCdpToGroupTokens { + creator: string; + denom: string; +} +export interface MsgConvertTokenInCdpToGroupTokensProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokens"; + value: Uint8Array; +} +export interface MsgConvertTokenInCdpToGroupTokensAmino { + creator?: string; + denom?: string; +} +export interface MsgConvertTokenInCdpToGroupTokensAminoMsg { + type: "cdp/ConvertTokenInCdpToGroupTokens"; + value: MsgConvertTokenInCdpToGroupTokensAmino; +} +export interface MsgConvertTokenInCdpToGroupTokensSDKType { + creator: string; + denom: string; +} +export interface MsgConvertTokenInCdpToGroupTokensResponse {} +export interface MsgConvertTokenInCdpToGroupTokensResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokensResponse"; + value: Uint8Array; +} +export interface MsgConvertTokenInCdpToGroupTokensResponseAmino {} +export interface MsgConvertTokenInCdpToGroupTokensResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokensResponse"; + value: MsgConvertTokenInCdpToGroupTokensResponseAmino; +} +export interface MsgConvertTokenInCdpToGroupTokensResponseSDKType {} +export interface MsgAddEModeCategory { + creator: string; + eModeCategory: EModeCategory | undefined; +} +export interface MsgAddEModeCategoryProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgAddEModeCategory"; + value: Uint8Array; +} +export interface MsgAddEModeCategoryAmino { + creator?: string; + e_mode_category?: EModeCategoryAmino | undefined; +} +export interface MsgAddEModeCategoryAminoMsg { + type: "cdp/AddEModeCategory"; + value: MsgAddEModeCategoryAmino; +} +export interface MsgAddEModeCategorySDKType { + creator: string; + e_mode_category: EModeCategorySDKType | undefined; +} +export interface MsgAddEModeCategoryResponse {} +export interface MsgAddEModeCategoryResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgAddEModeCategoryResponse"; + value: Uint8Array; +} +export interface MsgAddEModeCategoryResponseAmino {} +export interface MsgAddEModeCategoryResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgAddEModeCategoryResponse"; + value: MsgAddEModeCategoryResponseAmino; +} +export interface MsgAddEModeCategoryResponseSDKType {} +export interface MsgUpdateEModeCategory { + creator: string; + eModeCategoryName: string; + updateEModeCategoryParams: UpdateEModeCategoryParams | undefined; +} +export interface MsgUpdateEModeCategoryProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateEModeCategory"; + value: Uint8Array; +} +export interface MsgUpdateEModeCategoryAmino { + creator?: string; + e_mode_category_name?: string; + update_e_mode_category_params?: UpdateEModeCategoryParamsAmino | undefined; +} +export interface MsgUpdateEModeCategoryAminoMsg { + type: "cdp/UpdateEModeCategory"; + value: MsgUpdateEModeCategoryAmino; +} +export interface MsgUpdateEModeCategorySDKType { + creator: string; + e_mode_category_name: string; + update_e_mode_category_params: UpdateEModeCategoryParamsSDKType | undefined; +} +export interface UpdateEModeCategoryParams { + denoms: StringValue[]; + loanToValue?: Int64Value | undefined; + liquidationThreshold?: Int64Value | undefined; + liquidationDiscount?: Int64Value | undefined; + isActive?: BoolValue | undefined; +} +export interface UpdateEModeCategoryParamsProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.UpdateEModeCategoryParams"; + value: Uint8Array; +} +export interface UpdateEModeCategoryParamsAmino { + denoms?: StringValueAmino[]; + loan_to_value?: Int64ValueAmino | undefined; + liquidation_threshold?: Int64ValueAmino | undefined; + liquidation_discount?: Int64ValueAmino | undefined; + is_active?: BoolValueAmino | undefined; +} +export interface UpdateEModeCategoryParamsAminoMsg { + type: "/Switcheo.carbon.cdp.UpdateEModeCategoryParams"; + value: UpdateEModeCategoryParamsAmino; +} +export interface UpdateEModeCategoryParamsSDKType { + denoms: StringValueSDKType[]; + loan_to_value?: Int64ValueSDKType | undefined; + liquidation_threshold?: Int64ValueSDKType | undefined; + liquidation_discount?: Int64ValueSDKType | undefined; + is_active?: BoolValueSDKType | undefined; +} +export interface MsgUpdateEModeCategoryResponse {} +export interface MsgUpdateEModeCategoryResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateEModeCategoryResponse"; + value: Uint8Array; +} +export interface MsgUpdateEModeCategoryResponseAmino {} +export interface MsgUpdateEModeCategoryResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgUpdateEModeCategoryResponse"; + value: MsgUpdateEModeCategoryResponseAmino; +} +export interface MsgUpdateEModeCategoryResponseSDKType {} +export interface MsgSetAccountEMode { + creator: string; + eModeCategoryName: string; +} +export interface MsgSetAccountEModeProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetAccountEMode"; + value: Uint8Array; +} +export interface MsgSetAccountEModeAmino { + creator?: string; + e_mode_category_name?: string; +} +export interface MsgSetAccountEModeAminoMsg { + type: "cdp/SetAccountEMode"; + value: MsgSetAccountEModeAmino; +} +export interface MsgSetAccountEModeSDKType { + creator: string; + e_mode_category_name: string; +} +export interface MsgSetAccountEModeResponse {} +export interface MsgSetAccountEModeResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgSetAccountEModeResponse"; + value: Uint8Array; +} +export interface MsgSetAccountEModeResponseAmino {} +export interface MsgSetAccountEModeResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgSetAccountEModeResponse"; + value: MsgSetAccountEModeResponseAmino; +} +export interface MsgSetAccountEModeResponseSDKType {} +export interface MsgRemoveAccountEMode { + creator: string; +} +export interface MsgRemoveAccountEModeProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveAccountEMode"; + value: Uint8Array; +} +export interface MsgRemoveAccountEModeAmino { + creator?: string; +} +export interface MsgRemoveAccountEModeAminoMsg { + type: "cdp/RemoveAccountEMode"; + value: MsgRemoveAccountEModeAmino; +} +export interface MsgRemoveAccountEModeSDKType { + creator: string; +} +export interface MsgRemoveAccountEModeResponse {} +export interface MsgRemoveAccountEModeResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveAccountEModeResponse"; + value: Uint8Array; +} +export interface MsgRemoveAccountEModeResponseAmino {} +export interface MsgRemoveAccountEModeResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgRemoveAccountEModeResponse"; + value: MsgRemoveAccountEModeResponseAmino; +} +export interface MsgRemoveAccountEModeResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** params defines the optional parameters to update. */ + params: ParamsToUpdate | undefined; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority?: string; + /** params defines the optional parameters to update. */ + params?: ParamsToUpdateAmino | undefined; +} +export interface MsgUpdateParamsAminoMsg { + type: "cdp/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsToUpdateSDKType | undefined; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/Switcheo.carbon.cdp.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgAddRateStrategy(): MsgAddRateStrategy { + return { + creator: "", + rateStrategyParams: RateStrategyParams.fromPartial({}) + }; +} +export const MsgAddRateStrategy = { + typeUrl: "/Switcheo.carbon.cdp.MsgAddRateStrategy", + encode(message: MsgAddRateStrategy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.rateStrategyParams !== undefined) { + RateStrategyParams.encode(message.rateStrategyParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAddRateStrategy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddRateStrategy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.rateStrategyParams = RateStrategyParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddRateStrategy { + const message = createBaseMsgAddRateStrategy(); + message.creator = object.creator ?? ""; + message.rateStrategyParams = object.rateStrategyParams !== undefined && object.rateStrategyParams !== null ? RateStrategyParams.fromPartial(object.rateStrategyParams) : undefined; + return message; + }, + fromAmino(object: MsgAddRateStrategyAmino): MsgAddRateStrategy { + const message = createBaseMsgAddRateStrategy(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.rate_strategy_params !== undefined && object.rate_strategy_params !== null) { + message.rateStrategyParams = RateStrategyParams.fromAmino(object.rate_strategy_params); + } + return message; + }, + toAmino(message: MsgAddRateStrategy, useInterfaces: boolean = false): MsgAddRateStrategyAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.rate_strategy_params = message.rateStrategyParams ? RateStrategyParams.toAmino(message.rateStrategyParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgAddRateStrategyAminoMsg): MsgAddRateStrategy { + return MsgAddRateStrategy.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddRateStrategy, useInterfaces: boolean = false): MsgAddRateStrategyAminoMsg { + return { + type: "cdp/AddRateStrategy", + value: MsgAddRateStrategy.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgAddRateStrategyProtoMsg, useInterfaces: boolean = false): MsgAddRateStrategy { + return MsgAddRateStrategy.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAddRateStrategy): Uint8Array { + return MsgAddRateStrategy.encode(message).finish(); + }, + toProtoMsg(message: MsgAddRateStrategy): MsgAddRateStrategyProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddRateStrategy", + value: MsgAddRateStrategy.encode(message).finish() + }; + } +}; +function createBaseMsgAddRateStrategyResponse(): MsgAddRateStrategyResponse { + return { + rateStrategyParams: RateStrategyParams.fromPartial({}) + }; +} +export const MsgAddRateStrategyResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgAddRateStrategyResponse", + encode(message: MsgAddRateStrategyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rateStrategyParams !== undefined) { + RateStrategyParams.encode(message.rateStrategyParams, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAddRateStrategyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddRateStrategyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rateStrategyParams = RateStrategyParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddRateStrategyResponse { + const message = createBaseMsgAddRateStrategyResponse(); + message.rateStrategyParams = object.rateStrategyParams !== undefined && object.rateStrategyParams !== null ? RateStrategyParams.fromPartial(object.rateStrategyParams) : undefined; + return message; + }, + fromAmino(object: MsgAddRateStrategyResponseAmino): MsgAddRateStrategyResponse { + const message = createBaseMsgAddRateStrategyResponse(); + if (object.rate_strategy_params !== undefined && object.rate_strategy_params !== null) { + message.rateStrategyParams = RateStrategyParams.fromAmino(object.rate_strategy_params); + } + return message; + }, + toAmino(message: MsgAddRateStrategyResponse, useInterfaces: boolean = false): MsgAddRateStrategyResponseAmino { + const obj: any = {}; + obj.rate_strategy_params = message.rateStrategyParams ? RateStrategyParams.toAmino(message.rateStrategyParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgAddRateStrategyResponseAminoMsg): MsgAddRateStrategyResponse { + return MsgAddRateStrategyResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAddRateStrategyResponseProtoMsg, useInterfaces: boolean = false): MsgAddRateStrategyResponse { + return MsgAddRateStrategyResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAddRateStrategyResponse): Uint8Array { + return MsgAddRateStrategyResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddRateStrategyResponse): MsgAddRateStrategyResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddRateStrategyResponse", + value: MsgAddRateStrategyResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateRateStrategy(): MsgUpdateRateStrategy { + return { + creator: "", + rateStrategyParams: RateStrategyParams.fromPartial({}) + }; +} +export const MsgUpdateRateStrategy = { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRateStrategy", + encode(message: MsgUpdateRateStrategy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.rateStrategyParams !== undefined) { + RateStrategyParams.encode(message.rateStrategyParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateRateStrategy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateRateStrategy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.rateStrategyParams = RateStrategyParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateRateStrategy { + const message = createBaseMsgUpdateRateStrategy(); + message.creator = object.creator ?? ""; + message.rateStrategyParams = object.rateStrategyParams !== undefined && object.rateStrategyParams !== null ? RateStrategyParams.fromPartial(object.rateStrategyParams) : undefined; + return message; + }, + fromAmino(object: MsgUpdateRateStrategyAmino): MsgUpdateRateStrategy { + const message = createBaseMsgUpdateRateStrategy(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.rate_strategy_params !== undefined && object.rate_strategy_params !== null) { + message.rateStrategyParams = RateStrategyParams.fromAmino(object.rate_strategy_params); + } + return message; + }, + toAmino(message: MsgUpdateRateStrategy, useInterfaces: boolean = false): MsgUpdateRateStrategyAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.rate_strategy_params = message.rateStrategyParams ? RateStrategyParams.toAmino(message.rateStrategyParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateRateStrategyAminoMsg): MsgUpdateRateStrategy { + return MsgUpdateRateStrategy.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateRateStrategy, useInterfaces: boolean = false): MsgUpdateRateStrategyAminoMsg { + return { + type: "cdp/UpdateRateStrategy", + value: MsgUpdateRateStrategy.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateRateStrategyProtoMsg, useInterfaces: boolean = false): MsgUpdateRateStrategy { + return MsgUpdateRateStrategy.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateRateStrategy): Uint8Array { + return MsgUpdateRateStrategy.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateRateStrategy): MsgUpdateRateStrategyProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRateStrategy", + value: MsgUpdateRateStrategy.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateRateStrategyResponse(): MsgUpdateRateStrategyResponse { + return { + rateStrategyParams: RateStrategyParams.fromPartial({}) + }; +} +export const MsgUpdateRateStrategyResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRateStrategyResponse", + encode(message: MsgUpdateRateStrategyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rateStrategyParams !== undefined) { + RateStrategyParams.encode(message.rateStrategyParams, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateRateStrategyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateRateStrategyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rateStrategyParams = RateStrategyParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateRateStrategyResponse { + const message = createBaseMsgUpdateRateStrategyResponse(); + message.rateStrategyParams = object.rateStrategyParams !== undefined && object.rateStrategyParams !== null ? RateStrategyParams.fromPartial(object.rateStrategyParams) : undefined; + return message; + }, + fromAmino(object: MsgUpdateRateStrategyResponseAmino): MsgUpdateRateStrategyResponse { + const message = createBaseMsgUpdateRateStrategyResponse(); + if (object.rate_strategy_params !== undefined && object.rate_strategy_params !== null) { + message.rateStrategyParams = RateStrategyParams.fromAmino(object.rate_strategy_params); + } + return message; + }, + toAmino(message: MsgUpdateRateStrategyResponse, useInterfaces: boolean = false): MsgUpdateRateStrategyResponseAmino { + const obj: any = {}; + obj.rate_strategy_params = message.rateStrategyParams ? RateStrategyParams.toAmino(message.rateStrategyParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateRateStrategyResponseAminoMsg): MsgUpdateRateStrategyResponse { + return MsgUpdateRateStrategyResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateRateStrategyResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateRateStrategyResponse { + return MsgUpdateRateStrategyResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateRateStrategyResponse): Uint8Array { + return MsgUpdateRateStrategyResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateRateStrategyResponse): MsgUpdateRateStrategyResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRateStrategyResponse", + value: MsgUpdateRateStrategyResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveRateStrategy(): MsgRemoveRateStrategy { + return { + creator: "", + name: "" + }; +} +export const MsgRemoveRateStrategy = { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveRateStrategy", + encode(message: MsgRemoveRateStrategy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRemoveRateStrategy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveRateStrategy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveRateStrategy { + const message = createBaseMsgRemoveRateStrategy(); + message.creator = object.creator ?? ""; + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: MsgRemoveRateStrategyAmino): MsgRemoveRateStrategy { + const message = createBaseMsgRemoveRateStrategy(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: MsgRemoveRateStrategy, useInterfaces: boolean = false): MsgRemoveRateStrategyAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.name = message.name === "" ? undefined : message.name; + return obj; + }, + fromAminoMsg(object: MsgRemoveRateStrategyAminoMsg): MsgRemoveRateStrategy { + return MsgRemoveRateStrategy.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveRateStrategy, useInterfaces: boolean = false): MsgRemoveRateStrategyAminoMsg { + return { + type: "cdp/RemoveRateStrategy", + value: MsgRemoveRateStrategy.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgRemoveRateStrategyProtoMsg, useInterfaces: boolean = false): MsgRemoveRateStrategy { + return MsgRemoveRateStrategy.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRemoveRateStrategy): Uint8Array { + return MsgRemoveRateStrategy.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveRateStrategy): MsgRemoveRateStrategyProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveRateStrategy", + value: MsgRemoveRateStrategy.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveRateStrategyResponse(): MsgRemoveRateStrategyResponse { + return { + name: "" + }; +} +export const MsgRemoveRateStrategyResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveRateStrategyResponse", + encode(message: MsgRemoveRateStrategyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRemoveRateStrategyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveRateStrategyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveRateStrategyResponse { + const message = createBaseMsgRemoveRateStrategyResponse(); + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: MsgRemoveRateStrategyResponseAmino): MsgRemoveRateStrategyResponse { + const message = createBaseMsgRemoveRateStrategyResponse(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: MsgRemoveRateStrategyResponse, useInterfaces: boolean = false): MsgRemoveRateStrategyResponseAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + return obj; + }, + fromAminoMsg(object: MsgRemoveRateStrategyResponseAminoMsg): MsgRemoveRateStrategyResponse { + return MsgRemoveRateStrategyResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRemoveRateStrategyResponseProtoMsg, useInterfaces: boolean = false): MsgRemoveRateStrategyResponse { + return MsgRemoveRateStrategyResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRemoveRateStrategyResponse): Uint8Array { + return MsgRemoveRateStrategyResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveRateStrategyResponse): MsgRemoveRateStrategyResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveRateStrategyResponse", + value: MsgRemoveRateStrategyResponse.encode(message).finish() + }; + } +}; +function createBaseMsgAddAsset(): MsgAddAsset { + return { + creator: "", + assetParams: AssetParams.fromPartial({}) + }; +} +export const MsgAddAsset = { + typeUrl: "/Switcheo.carbon.cdp.MsgAddAsset", + encode(message: MsgAddAsset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.assetParams !== undefined) { + AssetParams.encode(message.assetParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAddAsset { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.assetParams = AssetParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddAsset { + const message = createBaseMsgAddAsset(); + message.creator = object.creator ?? ""; + message.assetParams = object.assetParams !== undefined && object.assetParams !== null ? AssetParams.fromPartial(object.assetParams) : undefined; + return message; + }, + fromAmino(object: MsgAddAssetAmino): MsgAddAsset { + const message = createBaseMsgAddAsset(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.asset_params !== undefined && object.asset_params !== null) { + message.assetParams = AssetParams.fromAmino(object.asset_params); + } + return message; + }, + toAmino(message: MsgAddAsset, useInterfaces: boolean = false): MsgAddAssetAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.asset_params = message.assetParams ? AssetParams.toAmino(message.assetParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgAddAssetAminoMsg): MsgAddAsset { + return MsgAddAsset.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddAsset, useInterfaces: boolean = false): MsgAddAssetAminoMsg { + return { + type: "cdp/AddAsset", + value: MsgAddAsset.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgAddAssetProtoMsg, useInterfaces: boolean = false): MsgAddAsset { + return MsgAddAsset.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAddAsset): Uint8Array { + return MsgAddAsset.encode(message).finish(); + }, + toProtoMsg(message: MsgAddAsset): MsgAddAssetProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddAsset", + value: MsgAddAsset.encode(message).finish() + }; + } +}; +function createBaseMsgAddAssetResponse(): MsgAddAssetResponse { + return { + assetParams: AssetParams.fromPartial({}) + }; +} +export const MsgAddAssetResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgAddAssetResponse", + encode(message: MsgAddAssetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetParams !== undefined) { + AssetParams.encode(message.assetParams, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAddAssetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddAssetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetParams = AssetParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddAssetResponse { + const message = createBaseMsgAddAssetResponse(); + message.assetParams = object.assetParams !== undefined && object.assetParams !== null ? AssetParams.fromPartial(object.assetParams) : undefined; + return message; + }, + fromAmino(object: MsgAddAssetResponseAmino): MsgAddAssetResponse { + const message = createBaseMsgAddAssetResponse(); + if (object.asset_params !== undefined && object.asset_params !== null) { + message.assetParams = AssetParams.fromAmino(object.asset_params); + } + return message; + }, + toAmino(message: MsgAddAssetResponse, useInterfaces: boolean = false): MsgAddAssetResponseAmino { + const obj: any = {}; + obj.asset_params = message.assetParams ? AssetParams.toAmino(message.assetParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgAddAssetResponseAminoMsg): MsgAddAssetResponse { + return MsgAddAssetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAddAssetResponseProtoMsg, useInterfaces: boolean = false): MsgAddAssetResponse { + return MsgAddAssetResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAddAssetResponse): Uint8Array { + return MsgAddAssetResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddAssetResponse): MsgAddAssetResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddAssetResponse", + value: MsgAddAssetResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAsset(): MsgUpdateAsset { + return { + creator: "", + assetParams: UpdateAssetParams.fromPartial({}) + }; +} +export const MsgUpdateAsset = { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateAsset", + encode(message: MsgUpdateAsset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.assetParams !== undefined) { + UpdateAssetParams.encode(message.assetParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateAsset { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.assetParams = UpdateAssetParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateAsset { + const message = createBaseMsgUpdateAsset(); + message.creator = object.creator ?? ""; + message.assetParams = object.assetParams !== undefined && object.assetParams !== null ? UpdateAssetParams.fromPartial(object.assetParams) : undefined; + return message; + }, + fromAmino(object: MsgUpdateAssetAmino): MsgUpdateAsset { + const message = createBaseMsgUpdateAsset(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.asset_params !== undefined && object.asset_params !== null) { + message.assetParams = UpdateAssetParams.fromAmino(object.asset_params); + } + return message; + }, + toAmino(message: MsgUpdateAsset, useInterfaces: boolean = false): MsgUpdateAssetAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.asset_params = message.assetParams ? UpdateAssetParams.toAmino(message.assetParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateAssetAminoMsg): MsgUpdateAsset { + return MsgUpdateAsset.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateAsset, useInterfaces: boolean = false): MsgUpdateAssetAminoMsg { + return { + type: "cdp/UpdateAsset", + value: MsgUpdateAsset.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateAssetProtoMsg, useInterfaces: boolean = false): MsgUpdateAsset { + return MsgUpdateAsset.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateAsset): Uint8Array { + return MsgUpdateAsset.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAsset): MsgUpdateAssetProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateAsset", + value: MsgUpdateAsset.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAssetResponse(): MsgUpdateAssetResponse { + return { + assetParams: AssetParams.fromPartial({}) + }; +} +export const MsgUpdateAssetResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateAssetResponse", + encode(message: MsgUpdateAssetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.assetParams !== undefined) { + AssetParams.encode(message.assetParams, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateAssetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAssetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assetParams = AssetParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateAssetResponse { + const message = createBaseMsgUpdateAssetResponse(); + message.assetParams = object.assetParams !== undefined && object.assetParams !== null ? AssetParams.fromPartial(object.assetParams) : undefined; + return message; + }, + fromAmino(object: MsgUpdateAssetResponseAmino): MsgUpdateAssetResponse { + const message = createBaseMsgUpdateAssetResponse(); + if (object.asset_params !== undefined && object.asset_params !== null) { + message.assetParams = AssetParams.fromAmino(object.asset_params); + } + return message; + }, + toAmino(message: MsgUpdateAssetResponse, useInterfaces: boolean = false): MsgUpdateAssetResponseAmino { + const obj: any = {}; + obj.asset_params = message.assetParams ? AssetParams.toAmino(message.assetParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateAssetResponseAminoMsg): MsgUpdateAssetResponse { + return MsgUpdateAssetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateAssetResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateAssetResponse { + return MsgUpdateAssetResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateAssetResponse): Uint8Array { + return MsgUpdateAssetResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAssetResponse): MsgUpdateAssetResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateAssetResponse", + value: MsgUpdateAssetResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSupplyAsset(): MsgSupplyAsset { + return { + creator: "", + denom: "", + amount: "" + }; +} +export const MsgSupplyAsset = { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAsset", + encode(message: MsgSupplyAsset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSupplyAsset { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSupplyAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSupplyAsset { + const message = createBaseMsgSupplyAsset(); + message.creator = object.creator ?? ""; + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: MsgSupplyAssetAmino): MsgSupplyAsset { + const message = createBaseMsgSupplyAsset(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: MsgSupplyAsset, useInterfaces: boolean = false): MsgSupplyAssetAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: MsgSupplyAssetAminoMsg): MsgSupplyAsset { + return MsgSupplyAsset.fromAmino(object.value); + }, + toAminoMsg(message: MsgSupplyAsset, useInterfaces: boolean = false): MsgSupplyAssetAminoMsg { + return { + type: "cdp/SupplyAsset", + value: MsgSupplyAsset.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSupplyAssetProtoMsg, useInterfaces: boolean = false): MsgSupplyAsset { + return MsgSupplyAsset.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSupplyAsset): Uint8Array { + return MsgSupplyAsset.encode(message).finish(); + }, + toProtoMsg(message: MsgSupplyAsset): MsgSupplyAssetProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAsset", + value: MsgSupplyAsset.encode(message).finish() + }; + } +}; +function createBaseMsgSupplyAssetResponse(): MsgSupplyAssetResponse { + return {}; +} +export const MsgSupplyAssetResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetResponse", + encode(_: MsgSupplyAssetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSupplyAssetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSupplyAssetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSupplyAssetResponse { + const message = createBaseMsgSupplyAssetResponse(); + return message; + }, + fromAmino(_: MsgSupplyAssetResponseAmino): MsgSupplyAssetResponse { + const message = createBaseMsgSupplyAssetResponse(); + return message; + }, + toAmino(_: MsgSupplyAssetResponse, useInterfaces: boolean = false): MsgSupplyAssetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSupplyAssetResponseAminoMsg): MsgSupplyAssetResponse { + return MsgSupplyAssetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSupplyAssetResponseProtoMsg, useInterfaces: boolean = false): MsgSupplyAssetResponse { + return MsgSupplyAssetResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSupplyAssetResponse): Uint8Array { + return MsgSupplyAssetResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSupplyAssetResponse): MsgSupplyAssetResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetResponse", + value: MsgSupplyAssetResponse.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawAsset(): MsgWithdrawAsset { + return { + creator: "", + cibtDenom: "", + amount: "" + }; +} +export const MsgWithdrawAsset = { + typeUrl: "/Switcheo.carbon.cdp.MsgWithdrawAsset", + encode(message: MsgWithdrawAsset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.cibtDenom !== "") { + writer.uint32(18).string(message.cibtDenom); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgWithdrawAsset { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.cibtDenom = reader.string(); + break; + case 3: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgWithdrawAsset { + const message = createBaseMsgWithdrawAsset(); + message.creator = object.creator ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawAssetAmino): MsgWithdrawAsset { + const message = createBaseMsgWithdrawAsset(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: MsgWithdrawAsset, useInterfaces: boolean = false): MsgWithdrawAssetAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: MsgWithdrawAssetAminoMsg): MsgWithdrawAsset { + return MsgWithdrawAsset.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawAsset, useInterfaces: boolean = false): MsgWithdrawAssetAminoMsg { + return { + type: "cdp/WithdrawAsset", + value: MsgWithdrawAsset.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgWithdrawAssetProtoMsg, useInterfaces: boolean = false): MsgWithdrawAsset { + return MsgWithdrawAsset.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgWithdrawAsset): Uint8Array { + return MsgWithdrawAsset.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawAsset): MsgWithdrawAssetProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgWithdrawAsset", + value: MsgWithdrawAsset.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawAssetResponse(): MsgWithdrawAssetResponse { + return {}; +} +export const MsgWithdrawAssetResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgWithdrawAssetResponse", + encode(_: MsgWithdrawAssetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgWithdrawAssetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawAssetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgWithdrawAssetResponse { + const message = createBaseMsgWithdrawAssetResponse(); + return message; + }, + fromAmino(_: MsgWithdrawAssetResponseAmino): MsgWithdrawAssetResponse { + const message = createBaseMsgWithdrawAssetResponse(); + return message; + }, + toAmino(_: MsgWithdrawAssetResponse, useInterfaces: boolean = false): MsgWithdrawAssetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgWithdrawAssetResponseAminoMsg): MsgWithdrawAssetResponse { + return MsgWithdrawAssetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgWithdrawAssetResponseProtoMsg, useInterfaces: boolean = false): MsgWithdrawAssetResponse { + return MsgWithdrawAssetResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgWithdrawAssetResponse): Uint8Array { + return MsgWithdrawAssetResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawAssetResponse): MsgWithdrawAssetResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgWithdrawAssetResponse", + value: MsgWithdrawAssetResponse.encode(message).finish() + }; + } +}; +function createBaseMsgLockCollateral(): MsgLockCollateral { + return { + creator: "", + cibtDenom: "", + amount: "" + }; +} +export const MsgLockCollateral = { + typeUrl: "/Switcheo.carbon.cdp.MsgLockCollateral", + encode(message: MsgLockCollateral, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.cibtDenom !== "") { + writer.uint32(18).string(message.cibtDenom); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLockCollateral { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLockCollateral(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.cibtDenom = reader.string(); + break; + case 3: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLockCollateral { + const message = createBaseMsgLockCollateral(); + message.creator = object.creator ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: MsgLockCollateralAmino): MsgLockCollateral { + const message = createBaseMsgLockCollateral(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: MsgLockCollateral, useInterfaces: boolean = false): MsgLockCollateralAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: MsgLockCollateralAminoMsg): MsgLockCollateral { + return MsgLockCollateral.fromAmino(object.value); + }, + toAminoMsg(message: MsgLockCollateral, useInterfaces: boolean = false): MsgLockCollateralAminoMsg { + return { + type: "cdp/LockCollateral", + value: MsgLockCollateral.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgLockCollateralProtoMsg, useInterfaces: boolean = false): MsgLockCollateral { + return MsgLockCollateral.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLockCollateral): Uint8Array { + return MsgLockCollateral.encode(message).finish(); + }, + toProtoMsg(message: MsgLockCollateral): MsgLockCollateralProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgLockCollateral", + value: MsgLockCollateral.encode(message).finish() + }; + } +}; +function createBaseMsgLockCollateralResponse(): MsgLockCollateralResponse { + return {}; +} +export const MsgLockCollateralResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgLockCollateralResponse", + encode(_: MsgLockCollateralResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLockCollateralResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLockCollateralResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgLockCollateralResponse { + const message = createBaseMsgLockCollateralResponse(); + return message; + }, + fromAmino(_: MsgLockCollateralResponseAmino): MsgLockCollateralResponse { + const message = createBaseMsgLockCollateralResponse(); + return message; + }, + toAmino(_: MsgLockCollateralResponse, useInterfaces: boolean = false): MsgLockCollateralResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLockCollateralResponseAminoMsg): MsgLockCollateralResponse { + return MsgLockCollateralResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLockCollateralResponseProtoMsg, useInterfaces: boolean = false): MsgLockCollateralResponse { + return MsgLockCollateralResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLockCollateralResponse): Uint8Array { + return MsgLockCollateralResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLockCollateralResponse): MsgLockCollateralResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgLockCollateralResponse", + value: MsgLockCollateralResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUnlockCollateral(): MsgUnlockCollateral { + return { + creator: "", + cibtDenom: "", + amount: "" + }; +} +export const MsgUnlockCollateral = { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateral", + encode(message: MsgUnlockCollateral, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.cibtDenom !== "") { + writer.uint32(18).string(message.cibtDenom); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUnlockCollateral { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnlockCollateral(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.cibtDenom = reader.string(); + break; + case 3: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUnlockCollateral { + const message = createBaseMsgUnlockCollateral(); + message.creator = object.creator ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: MsgUnlockCollateralAmino): MsgUnlockCollateral { + const message = createBaseMsgUnlockCollateral(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: MsgUnlockCollateral, useInterfaces: boolean = false): MsgUnlockCollateralAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: MsgUnlockCollateralAminoMsg): MsgUnlockCollateral { + return MsgUnlockCollateral.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnlockCollateral, useInterfaces: boolean = false): MsgUnlockCollateralAminoMsg { + return { + type: "cdp/UnlockCollateral", + value: MsgUnlockCollateral.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUnlockCollateralProtoMsg, useInterfaces: boolean = false): MsgUnlockCollateral { + return MsgUnlockCollateral.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUnlockCollateral): Uint8Array { + return MsgUnlockCollateral.encode(message).finish(); + }, + toProtoMsg(message: MsgUnlockCollateral): MsgUnlockCollateralProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateral", + value: MsgUnlockCollateral.encode(message).finish() + }; + } +}; +function createBaseMsgUnlockCollateralResponse(): MsgUnlockCollateralResponse { + return {}; +} +export const MsgUnlockCollateralResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralResponse", + encode(_: MsgUnlockCollateralResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUnlockCollateralResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnlockCollateralResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUnlockCollateralResponse { + const message = createBaseMsgUnlockCollateralResponse(); + return message; + }, + fromAmino(_: MsgUnlockCollateralResponseAmino): MsgUnlockCollateralResponse { + const message = createBaseMsgUnlockCollateralResponse(); + return message; + }, + toAmino(_: MsgUnlockCollateralResponse, useInterfaces: boolean = false): MsgUnlockCollateralResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUnlockCollateralResponseAminoMsg): MsgUnlockCollateralResponse { + return MsgUnlockCollateralResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUnlockCollateralResponseProtoMsg, useInterfaces: boolean = false): MsgUnlockCollateralResponse { + return MsgUnlockCollateralResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUnlockCollateralResponse): Uint8Array { + return MsgUnlockCollateralResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUnlockCollateralResponse): MsgUnlockCollateralResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralResponse", + value: MsgUnlockCollateralResponse.encode(message).finish() + }; + } +}; +function createBaseMsgBorrowAsset(): MsgBorrowAsset { + return { + creator: "", + denom: "", + amount: "" + }; +} +export const MsgBorrowAsset = { + typeUrl: "/Switcheo.carbon.cdp.MsgBorrowAsset", + encode(message: MsgBorrowAsset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgBorrowAsset { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBorrowAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBorrowAsset { + const message = createBaseMsgBorrowAsset(); + message.creator = object.creator ?? ""; + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: MsgBorrowAssetAmino): MsgBorrowAsset { + const message = createBaseMsgBorrowAsset(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: MsgBorrowAsset, useInterfaces: boolean = false): MsgBorrowAssetAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: MsgBorrowAssetAminoMsg): MsgBorrowAsset { + return MsgBorrowAsset.fromAmino(object.value); + }, + toAminoMsg(message: MsgBorrowAsset, useInterfaces: boolean = false): MsgBorrowAssetAminoMsg { + return { + type: "cdp/BorrowAsset", + value: MsgBorrowAsset.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgBorrowAssetProtoMsg, useInterfaces: boolean = false): MsgBorrowAsset { + return MsgBorrowAsset.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgBorrowAsset): Uint8Array { + return MsgBorrowAsset.encode(message).finish(); + }, + toProtoMsg(message: MsgBorrowAsset): MsgBorrowAssetProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgBorrowAsset", + value: MsgBorrowAsset.encode(message).finish() + }; + } +}; +function createBaseMsgBorrowAssetResponse(): MsgBorrowAssetResponse { + return {}; +} +export const MsgBorrowAssetResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgBorrowAssetResponse", + encode(_: MsgBorrowAssetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgBorrowAssetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBorrowAssetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgBorrowAssetResponse { + const message = createBaseMsgBorrowAssetResponse(); + return message; + }, + fromAmino(_: MsgBorrowAssetResponseAmino): MsgBorrowAssetResponse { + const message = createBaseMsgBorrowAssetResponse(); + return message; + }, + toAmino(_: MsgBorrowAssetResponse, useInterfaces: boolean = false): MsgBorrowAssetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBorrowAssetResponseAminoMsg): MsgBorrowAssetResponse { + return MsgBorrowAssetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBorrowAssetResponseProtoMsg, useInterfaces: boolean = false): MsgBorrowAssetResponse { + return MsgBorrowAssetResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgBorrowAssetResponse): Uint8Array { + return MsgBorrowAssetResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBorrowAssetResponse): MsgBorrowAssetResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgBorrowAssetResponse", + value: MsgBorrowAssetResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRepayAsset(): MsgRepayAsset { + return { + creator: "", + denom: "", + amount: "", + debtor: "", + fromCollateral: false + }; +} +export const MsgRepayAsset = { + typeUrl: "/Switcheo.carbon.cdp.MsgRepayAsset", + encode(message: MsgRepayAsset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(26).string(message.amount); + } + if (message.debtor !== "") { + writer.uint32(34).string(message.debtor); + } + if (message.fromCollateral === true) { + writer.uint32(40).bool(message.fromCollateral); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRepayAsset { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRepayAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.amount = reader.string(); + break; + case 4: + message.debtor = reader.string(); + break; + case 5: + message.fromCollateral = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRepayAsset { + const message = createBaseMsgRepayAsset(); + message.creator = object.creator ?? ""; + message.denom = object.denom ?? ""; + message.amount = object.amount ?? ""; + message.debtor = object.debtor ?? ""; + message.fromCollateral = object.fromCollateral ?? false; + return message; + }, + fromAmino(object: MsgRepayAssetAmino): MsgRepayAsset { + const message = createBaseMsgRepayAsset(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.debtor !== undefined && object.debtor !== null) { + message.debtor = object.debtor; + } + if (object.from_collateral !== undefined && object.from_collateral !== null) { + message.fromCollateral = object.from_collateral; + } + return message; + }, + toAmino(message: MsgRepayAsset, useInterfaces: boolean = false): MsgRepayAssetAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount === "" ? undefined : message.amount; + obj.debtor = message.debtor === "" ? undefined : message.debtor; + obj.from_collateral = message.fromCollateral === false ? undefined : message.fromCollateral; + return obj; + }, + fromAminoMsg(object: MsgRepayAssetAminoMsg): MsgRepayAsset { + return MsgRepayAsset.fromAmino(object.value); + }, + toAminoMsg(message: MsgRepayAsset, useInterfaces: boolean = false): MsgRepayAssetAminoMsg { + return { + type: "cdp/RepayAsset", + value: MsgRepayAsset.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgRepayAssetProtoMsg, useInterfaces: boolean = false): MsgRepayAsset { + return MsgRepayAsset.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRepayAsset): Uint8Array { + return MsgRepayAsset.encode(message).finish(); + }, + toProtoMsg(message: MsgRepayAsset): MsgRepayAssetProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRepayAsset", + value: MsgRepayAsset.encode(message).finish() + }; + } +}; +function createBaseMsgRepayAssetResponse(): MsgRepayAssetResponse { + return {}; +} +export const MsgRepayAssetResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgRepayAssetResponse", + encode(_: MsgRepayAssetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRepayAssetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRepayAssetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRepayAssetResponse { + const message = createBaseMsgRepayAssetResponse(); + return message; + }, + fromAmino(_: MsgRepayAssetResponseAmino): MsgRepayAssetResponse { + const message = createBaseMsgRepayAssetResponse(); + return message; + }, + toAmino(_: MsgRepayAssetResponse, useInterfaces: boolean = false): MsgRepayAssetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRepayAssetResponseAminoMsg): MsgRepayAssetResponse { + return MsgRepayAssetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRepayAssetResponseProtoMsg, useInterfaces: boolean = false): MsgRepayAssetResponse { + return MsgRepayAssetResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRepayAssetResponse): Uint8Array { + return MsgRepayAssetResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRepayAssetResponse): MsgRepayAssetResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRepayAssetResponse", + value: MsgRepayAssetResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSupplyAssetAndLockCollateral(): MsgSupplyAssetAndLockCollateral { + return { + creator: "", + denom: "", + supplyAmount: "", + lockAmount: "" + }; +} +export const MsgSupplyAssetAndLockCollateral = { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateral", + encode(message: MsgSupplyAssetAndLockCollateral, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.supplyAmount !== "") { + writer.uint32(26).string(message.supplyAmount); + } + if (message.lockAmount !== "") { + writer.uint32(34).string(message.lockAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSupplyAssetAndLockCollateral { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSupplyAssetAndLockCollateral(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.supplyAmount = reader.string(); + break; + case 4: + message.lockAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSupplyAssetAndLockCollateral { + const message = createBaseMsgSupplyAssetAndLockCollateral(); + message.creator = object.creator ?? ""; + message.denom = object.denom ?? ""; + message.supplyAmount = object.supplyAmount ?? ""; + message.lockAmount = object.lockAmount ?? ""; + return message; + }, + fromAmino(object: MsgSupplyAssetAndLockCollateralAmino): MsgSupplyAssetAndLockCollateral { + const message = createBaseMsgSupplyAssetAndLockCollateral(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.supply_amount !== undefined && object.supply_amount !== null) { + message.supplyAmount = object.supply_amount; + } + if (object.lock_amount !== undefined && object.lock_amount !== null) { + message.lockAmount = object.lock_amount; + } + return message; + }, + toAmino(message: MsgSupplyAssetAndLockCollateral, useInterfaces: boolean = false): MsgSupplyAssetAndLockCollateralAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.supply_amount = message.supplyAmount === "" ? undefined : message.supplyAmount; + obj.lock_amount = message.lockAmount === "" ? undefined : message.lockAmount; + return obj; + }, + fromAminoMsg(object: MsgSupplyAssetAndLockCollateralAminoMsg): MsgSupplyAssetAndLockCollateral { + return MsgSupplyAssetAndLockCollateral.fromAmino(object.value); + }, + toAminoMsg(message: MsgSupplyAssetAndLockCollateral, useInterfaces: boolean = false): MsgSupplyAssetAndLockCollateralAminoMsg { + return { + type: "cdp/SupplyAssetAndLockCollateral", + value: MsgSupplyAssetAndLockCollateral.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSupplyAssetAndLockCollateralProtoMsg, useInterfaces: boolean = false): MsgSupplyAssetAndLockCollateral { + return MsgSupplyAssetAndLockCollateral.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSupplyAssetAndLockCollateral): Uint8Array { + return MsgSupplyAssetAndLockCollateral.encode(message).finish(); + }, + toProtoMsg(message: MsgSupplyAssetAndLockCollateral): MsgSupplyAssetAndLockCollateralProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateral", + value: MsgSupplyAssetAndLockCollateral.encode(message).finish() + }; + } +}; +function createBaseMsgSupplyAssetAndLockCollateralResponse(): MsgSupplyAssetAndLockCollateralResponse { + return {}; +} +export const MsgSupplyAssetAndLockCollateralResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateralResponse", + encode(_: MsgSupplyAssetAndLockCollateralResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSupplyAssetAndLockCollateralResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSupplyAssetAndLockCollateralResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSupplyAssetAndLockCollateralResponse { + const message = createBaseMsgSupplyAssetAndLockCollateralResponse(); + return message; + }, + fromAmino(_: MsgSupplyAssetAndLockCollateralResponseAmino): MsgSupplyAssetAndLockCollateralResponse { + const message = createBaseMsgSupplyAssetAndLockCollateralResponse(); + return message; + }, + toAmino(_: MsgSupplyAssetAndLockCollateralResponse, useInterfaces: boolean = false): MsgSupplyAssetAndLockCollateralResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSupplyAssetAndLockCollateralResponseAminoMsg): MsgSupplyAssetAndLockCollateralResponse { + return MsgSupplyAssetAndLockCollateralResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSupplyAssetAndLockCollateralResponseProtoMsg, useInterfaces: boolean = false): MsgSupplyAssetAndLockCollateralResponse { + return MsgSupplyAssetAndLockCollateralResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSupplyAssetAndLockCollateralResponse): Uint8Array { + return MsgSupplyAssetAndLockCollateralResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSupplyAssetAndLockCollateralResponse): MsgSupplyAssetAndLockCollateralResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSupplyAssetAndLockCollateralResponse", + value: MsgSupplyAssetAndLockCollateralResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUnlockCollateralAndWithdrawAsset(): MsgUnlockCollateralAndWithdrawAsset { + return { + creator: "", + cibtDenom: "", + unlockAmount: "", + withdrawAmount: "" + }; +} +export const MsgUnlockCollateralAndWithdrawAsset = { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAsset", + encode(message: MsgUnlockCollateralAndWithdrawAsset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.cibtDenom !== "") { + writer.uint32(18).string(message.cibtDenom); + } + if (message.unlockAmount !== "") { + writer.uint32(26).string(message.unlockAmount); + } + if (message.withdrawAmount !== "") { + writer.uint32(34).string(message.withdrawAmount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUnlockCollateralAndWithdrawAsset { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnlockCollateralAndWithdrawAsset(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.cibtDenom = reader.string(); + break; + case 3: + message.unlockAmount = reader.string(); + break; + case 4: + message.withdrawAmount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUnlockCollateralAndWithdrawAsset { + const message = createBaseMsgUnlockCollateralAndWithdrawAsset(); + message.creator = object.creator ?? ""; + message.cibtDenom = object.cibtDenom ?? ""; + message.unlockAmount = object.unlockAmount ?? ""; + message.withdrawAmount = object.withdrawAmount ?? ""; + return message; + }, + fromAmino(object: MsgUnlockCollateralAndWithdrawAssetAmino): MsgUnlockCollateralAndWithdrawAsset { + const message = createBaseMsgUnlockCollateralAndWithdrawAsset(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.cibt_denom !== undefined && object.cibt_denom !== null) { + message.cibtDenom = object.cibt_denom; + } + if (object.unlock_amount !== undefined && object.unlock_amount !== null) { + message.unlockAmount = object.unlock_amount; + } + if (object.withdraw_amount !== undefined && object.withdraw_amount !== null) { + message.withdrawAmount = object.withdraw_amount; + } + return message; + }, + toAmino(message: MsgUnlockCollateralAndWithdrawAsset, useInterfaces: boolean = false): MsgUnlockCollateralAndWithdrawAssetAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.cibt_denom = message.cibtDenom === "" ? undefined : message.cibtDenom; + obj.unlock_amount = message.unlockAmount === "" ? undefined : message.unlockAmount; + obj.withdraw_amount = message.withdrawAmount === "" ? undefined : message.withdrawAmount; + return obj; + }, + fromAminoMsg(object: MsgUnlockCollateralAndWithdrawAssetAminoMsg): MsgUnlockCollateralAndWithdrawAsset { + return MsgUnlockCollateralAndWithdrawAsset.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnlockCollateralAndWithdrawAsset, useInterfaces: boolean = false): MsgUnlockCollateralAndWithdrawAssetAminoMsg { + return { + type: "cdp/UnlockCollateralAndWithdrawAsset", + value: MsgUnlockCollateralAndWithdrawAsset.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUnlockCollateralAndWithdrawAssetProtoMsg, useInterfaces: boolean = false): MsgUnlockCollateralAndWithdrawAsset { + return MsgUnlockCollateralAndWithdrawAsset.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUnlockCollateralAndWithdrawAsset): Uint8Array { + return MsgUnlockCollateralAndWithdrawAsset.encode(message).finish(); + }, + toProtoMsg(message: MsgUnlockCollateralAndWithdrawAsset): MsgUnlockCollateralAndWithdrawAssetProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAsset", + value: MsgUnlockCollateralAndWithdrawAsset.encode(message).finish() + }; + } +}; +function createBaseMsgUnlockCollateralAndWithdrawAssetResponse(): MsgUnlockCollateralAndWithdrawAssetResponse { + return {}; +} +export const MsgUnlockCollateralAndWithdrawAssetResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAssetResponse", + encode(_: MsgUnlockCollateralAndWithdrawAssetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUnlockCollateralAndWithdrawAssetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnlockCollateralAndWithdrawAssetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUnlockCollateralAndWithdrawAssetResponse { + const message = createBaseMsgUnlockCollateralAndWithdrawAssetResponse(); + return message; + }, + fromAmino(_: MsgUnlockCollateralAndWithdrawAssetResponseAmino): MsgUnlockCollateralAndWithdrawAssetResponse { + const message = createBaseMsgUnlockCollateralAndWithdrawAssetResponse(); + return message; + }, + toAmino(_: MsgUnlockCollateralAndWithdrawAssetResponse, useInterfaces: boolean = false): MsgUnlockCollateralAndWithdrawAssetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUnlockCollateralAndWithdrawAssetResponseAminoMsg): MsgUnlockCollateralAndWithdrawAssetResponse { + return MsgUnlockCollateralAndWithdrawAssetResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUnlockCollateralAndWithdrawAssetResponseProtoMsg, useInterfaces: boolean = false): MsgUnlockCollateralAndWithdrawAssetResponse { + return MsgUnlockCollateralAndWithdrawAssetResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUnlockCollateralAndWithdrawAssetResponse): Uint8Array { + return MsgUnlockCollateralAndWithdrawAssetResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUnlockCollateralAndWithdrawAssetResponse): MsgUnlockCollateralAndWithdrawAssetResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUnlockCollateralAndWithdrawAssetResponse", + value: MsgUnlockCollateralAndWithdrawAssetResponse.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidateCollateral(): MsgLiquidateCollateral { + return { + creator: "", + debtor: "", + minCollateral: Coin.fromPartial({}), + debt: Coin.fromPartial({}), + stableInterest: undefined, + debtFromCollateral: false, + interestFromCollateral: false + }; +} +export const MsgLiquidateCollateral = { + typeUrl: "/Switcheo.carbon.cdp.MsgLiquidateCollateral", + encode(message: MsgLiquidateCollateral, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.debtor !== "") { + writer.uint32(18).string(message.debtor); + } + if (message.minCollateral !== undefined) { + Coin.encode(message.minCollateral, writer.uint32(26).fork()).ldelim(); + } + if (message.debt !== undefined) { + Coin.encode(message.debt, writer.uint32(34).fork()).ldelim(); + } + if (message.stableInterest !== undefined) { + Coin.encode(message.stableInterest, writer.uint32(42).fork()).ldelim(); + } + if (message.debtFromCollateral === true) { + writer.uint32(48).bool(message.debtFromCollateral); + } + if (message.interestFromCollateral === true) { + writer.uint32(56).bool(message.interestFromCollateral); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidateCollateral { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidateCollateral(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.debtor = reader.string(); + break; + case 3: + message.minCollateral = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.debt = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.stableInterest = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.debtFromCollateral = reader.bool(); + break; + case 7: + message.interestFromCollateral = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLiquidateCollateral { + const message = createBaseMsgLiquidateCollateral(); + message.creator = object.creator ?? ""; + message.debtor = object.debtor ?? ""; + message.minCollateral = object.minCollateral !== undefined && object.minCollateral !== null ? Coin.fromPartial(object.minCollateral) : undefined; + message.debt = object.debt !== undefined && object.debt !== null ? Coin.fromPartial(object.debt) : undefined; + message.stableInterest = object.stableInterest !== undefined && object.stableInterest !== null ? Coin.fromPartial(object.stableInterest) : undefined; + message.debtFromCollateral = object.debtFromCollateral ?? false; + message.interestFromCollateral = object.interestFromCollateral ?? false; + return message; + }, + fromAmino(object: MsgLiquidateCollateralAmino): MsgLiquidateCollateral { + const message = createBaseMsgLiquidateCollateral(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.debtor !== undefined && object.debtor !== null) { + message.debtor = object.debtor; + } + if (object.min_collateral !== undefined && object.min_collateral !== null) { + message.minCollateral = Coin.fromAmino(object.min_collateral); + } + if (object.debt !== undefined && object.debt !== null) { + message.debt = Coin.fromAmino(object.debt); + } + if (object.stable_interest !== undefined && object.stable_interest !== null) { + message.stableInterest = Coin.fromAmino(object.stable_interest); + } + if (object.debt_from_collateral !== undefined && object.debt_from_collateral !== null) { + message.debtFromCollateral = object.debt_from_collateral; + } + if (object.interest_from_collateral !== undefined && object.interest_from_collateral !== null) { + message.interestFromCollateral = object.interest_from_collateral; + } + return message; + }, + toAmino(message: MsgLiquidateCollateral, useInterfaces: boolean = false): MsgLiquidateCollateralAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.debtor = message.debtor === "" ? undefined : message.debtor; + obj.min_collateral = message.minCollateral ? Coin.toAmino(message.minCollateral, useInterfaces) : undefined; + obj.debt = message.debt ? Coin.toAmino(message.debt, useInterfaces) : undefined; + obj.stable_interest = message.stableInterest ? Coin.toAmino(message.stableInterest, useInterfaces) : undefined; + obj.debt_from_collateral = message.debtFromCollateral === false ? undefined : message.debtFromCollateral; + obj.interest_from_collateral = message.interestFromCollateral === false ? undefined : message.interestFromCollateral; + return obj; + }, + fromAminoMsg(object: MsgLiquidateCollateralAminoMsg): MsgLiquidateCollateral { + return MsgLiquidateCollateral.fromAmino(object.value); + }, + toAminoMsg(message: MsgLiquidateCollateral, useInterfaces: boolean = false): MsgLiquidateCollateralAminoMsg { + return { + type: "cdp/LiquidateCollateral", + value: MsgLiquidateCollateral.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgLiquidateCollateralProtoMsg, useInterfaces: boolean = false): MsgLiquidateCollateral { + return MsgLiquidateCollateral.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidateCollateral): Uint8Array { + return MsgLiquidateCollateral.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidateCollateral): MsgLiquidateCollateralProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgLiquidateCollateral", + value: MsgLiquidateCollateral.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidateCollateralResponse(): MsgLiquidateCollateralResponse { + return {}; +} +export const MsgLiquidateCollateralResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgLiquidateCollateralResponse", + encode(_: MsgLiquidateCollateralResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidateCollateralResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidateCollateralResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgLiquidateCollateralResponse { + const message = createBaseMsgLiquidateCollateralResponse(); + return message; + }, + fromAmino(_: MsgLiquidateCollateralResponseAmino): MsgLiquidateCollateralResponse { + const message = createBaseMsgLiquidateCollateralResponse(); + return message; + }, + toAmino(_: MsgLiquidateCollateralResponse, useInterfaces: boolean = false): MsgLiquidateCollateralResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLiquidateCollateralResponseAminoMsg): MsgLiquidateCollateralResponse { + return MsgLiquidateCollateralResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidateCollateralResponseProtoMsg, useInterfaces: boolean = false): MsgLiquidateCollateralResponse { + return MsgLiquidateCollateralResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidateCollateralResponse): Uint8Array { + return MsgLiquidateCollateralResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidateCollateralResponse): MsgLiquidateCollateralResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgLiquidateCollateralResponse", + value: MsgLiquidateCollateralResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetLiquidationFee(): MsgSetLiquidationFee { + return { + creator: "", + liquidationFee: "" + }; +} +export const MsgSetLiquidationFee = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetLiquidationFee", + encode(message: MsgSetLiquidationFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.liquidationFee !== "") { + writer.uint32(18).string(message.liquidationFee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetLiquidationFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetLiquidationFee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.liquidationFee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetLiquidationFee { + const message = createBaseMsgSetLiquidationFee(); + message.creator = object.creator ?? ""; + message.liquidationFee = object.liquidationFee ?? ""; + return message; + }, + fromAmino(object: MsgSetLiquidationFeeAmino): MsgSetLiquidationFee { + const message = createBaseMsgSetLiquidationFee(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.liquidation_fee !== undefined && object.liquidation_fee !== null) { + message.liquidationFee = object.liquidation_fee; + } + return message; + }, + toAmino(message: MsgSetLiquidationFee, useInterfaces: boolean = false): MsgSetLiquidationFeeAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.liquidation_fee = message.liquidationFee === "" ? undefined : message.liquidationFee; + return obj; + }, + fromAminoMsg(object: MsgSetLiquidationFeeAminoMsg): MsgSetLiquidationFee { + return MsgSetLiquidationFee.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetLiquidationFee, useInterfaces: boolean = false): MsgSetLiquidationFeeAminoMsg { + return { + type: "cdp/SetLiquidationFee", + value: MsgSetLiquidationFee.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetLiquidationFeeProtoMsg, useInterfaces: boolean = false): MsgSetLiquidationFee { + return MsgSetLiquidationFee.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetLiquidationFee): Uint8Array { + return MsgSetLiquidationFee.encode(message).finish(); + }, + toProtoMsg(message: MsgSetLiquidationFee): MsgSetLiquidationFeeProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetLiquidationFee", + value: MsgSetLiquidationFee.encode(message).finish() + }; + } +}; +function createBaseMsgSetLiquidationFeeResponse(): MsgSetLiquidationFeeResponse { + return {}; +} +export const MsgSetLiquidationFeeResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetLiquidationFeeResponse", + encode(_: MsgSetLiquidationFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetLiquidationFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetLiquidationFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetLiquidationFeeResponse { + const message = createBaseMsgSetLiquidationFeeResponse(); + return message; + }, + fromAmino(_: MsgSetLiquidationFeeResponseAmino): MsgSetLiquidationFeeResponse { + const message = createBaseMsgSetLiquidationFeeResponse(); + return message; + }, + toAmino(_: MsgSetLiquidationFeeResponse, useInterfaces: boolean = false): MsgSetLiquidationFeeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetLiquidationFeeResponseAminoMsg): MsgSetLiquidationFeeResponse { + return MsgSetLiquidationFeeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetLiquidationFeeResponseProtoMsg, useInterfaces: boolean = false): MsgSetLiquidationFeeResponse { + return MsgSetLiquidationFeeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetLiquidationFeeResponse): Uint8Array { + return MsgSetLiquidationFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetLiquidationFeeResponse): MsgSetLiquidationFeeResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetLiquidationFeeResponse", + value: MsgSetLiquidationFeeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetInterestFee(): MsgSetInterestFee { + return { + creator: "", + interestFee: "" + }; +} +export const MsgSetInterestFee = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetInterestFee", + encode(message: MsgSetInterestFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.interestFee !== "") { + writer.uint32(18).string(message.interestFee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetInterestFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetInterestFee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.interestFee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetInterestFee { + const message = createBaseMsgSetInterestFee(); + message.creator = object.creator ?? ""; + message.interestFee = object.interestFee ?? ""; + return message; + }, + fromAmino(object: MsgSetInterestFeeAmino): MsgSetInterestFee { + const message = createBaseMsgSetInterestFee(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.interest_fee !== undefined && object.interest_fee !== null) { + message.interestFee = object.interest_fee; + } + return message; + }, + toAmino(message: MsgSetInterestFee, useInterfaces: boolean = false): MsgSetInterestFeeAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.interest_fee = message.interestFee === "" ? undefined : message.interestFee; + return obj; + }, + fromAminoMsg(object: MsgSetInterestFeeAminoMsg): MsgSetInterestFee { + return MsgSetInterestFee.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetInterestFee, useInterfaces: boolean = false): MsgSetInterestFeeAminoMsg { + return { + type: "cdp/SetInterestFee", + value: MsgSetInterestFee.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetInterestFeeProtoMsg, useInterfaces: boolean = false): MsgSetInterestFee { + return MsgSetInterestFee.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetInterestFee): Uint8Array { + return MsgSetInterestFee.encode(message).finish(); + }, + toProtoMsg(message: MsgSetInterestFee): MsgSetInterestFeeProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetInterestFee", + value: MsgSetInterestFee.encode(message).finish() + }; + } +}; +function createBaseMsgSetInterestFeeResponse(): MsgSetInterestFeeResponse { + return {}; +} +export const MsgSetInterestFeeResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetInterestFeeResponse", + encode(_: MsgSetInterestFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetInterestFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetInterestFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetInterestFeeResponse { + const message = createBaseMsgSetInterestFeeResponse(); + return message; + }, + fromAmino(_: MsgSetInterestFeeResponseAmino): MsgSetInterestFeeResponse { + const message = createBaseMsgSetInterestFeeResponse(); + return message; + }, + toAmino(_: MsgSetInterestFeeResponse, useInterfaces: boolean = false): MsgSetInterestFeeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetInterestFeeResponseAminoMsg): MsgSetInterestFeeResponse { + return MsgSetInterestFeeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetInterestFeeResponseProtoMsg, useInterfaces: boolean = false): MsgSetInterestFeeResponse { + return MsgSetInterestFeeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetInterestFeeResponse): Uint8Array { + return MsgSetInterestFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetInterestFeeResponse): MsgSetInterestFeeResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetInterestFeeResponse", + value: MsgSetInterestFeeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetStablecoinMintCap(): MsgSetStablecoinMintCap { + return { + creator: "", + stablecoinMintCap: "" + }; +} +export const MsgSetStablecoinMintCap = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinMintCap", + encode(message: MsgSetStablecoinMintCap, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.stablecoinMintCap !== "") { + writer.uint32(18).string(message.stablecoinMintCap); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetStablecoinMintCap { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetStablecoinMintCap(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.stablecoinMintCap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetStablecoinMintCap { + const message = createBaseMsgSetStablecoinMintCap(); + message.creator = object.creator ?? ""; + message.stablecoinMintCap = object.stablecoinMintCap ?? ""; + return message; + }, + fromAmino(object: MsgSetStablecoinMintCapAmino): MsgSetStablecoinMintCap { + const message = createBaseMsgSetStablecoinMintCap(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.stablecoin_mint_cap !== undefined && object.stablecoin_mint_cap !== null) { + message.stablecoinMintCap = object.stablecoin_mint_cap; + } + return message; + }, + toAmino(message: MsgSetStablecoinMintCap, useInterfaces: boolean = false): MsgSetStablecoinMintCapAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.stablecoin_mint_cap = message.stablecoinMintCap === "" ? undefined : message.stablecoinMintCap; + return obj; + }, + fromAminoMsg(object: MsgSetStablecoinMintCapAminoMsg): MsgSetStablecoinMintCap { + return MsgSetStablecoinMintCap.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetStablecoinMintCap, useInterfaces: boolean = false): MsgSetStablecoinMintCapAminoMsg { + return { + type: "cdp/SetStablecoinMintCap", + value: MsgSetStablecoinMintCap.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetStablecoinMintCapProtoMsg, useInterfaces: boolean = false): MsgSetStablecoinMintCap { + return MsgSetStablecoinMintCap.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetStablecoinMintCap): Uint8Array { + return MsgSetStablecoinMintCap.encode(message).finish(); + }, + toProtoMsg(message: MsgSetStablecoinMintCap): MsgSetStablecoinMintCapProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinMintCap", + value: MsgSetStablecoinMintCap.encode(message).finish() + }; + } +}; +function createBaseMsgSetStablecoinMintCapResponse(): MsgSetStablecoinMintCapResponse { + return {}; +} +export const MsgSetStablecoinMintCapResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinMintCapResponse", + encode(_: MsgSetStablecoinMintCapResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetStablecoinMintCapResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetStablecoinMintCapResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetStablecoinMintCapResponse { + const message = createBaseMsgSetStablecoinMintCapResponse(); + return message; + }, + fromAmino(_: MsgSetStablecoinMintCapResponseAmino): MsgSetStablecoinMintCapResponse { + const message = createBaseMsgSetStablecoinMintCapResponse(); + return message; + }, + toAmino(_: MsgSetStablecoinMintCapResponse, useInterfaces: boolean = false): MsgSetStablecoinMintCapResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetStablecoinMintCapResponseAminoMsg): MsgSetStablecoinMintCapResponse { + return MsgSetStablecoinMintCapResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetStablecoinMintCapResponseProtoMsg, useInterfaces: boolean = false): MsgSetStablecoinMintCapResponse { + return MsgSetStablecoinMintCapResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetStablecoinMintCapResponse): Uint8Array { + return MsgSetStablecoinMintCapResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetStablecoinMintCapResponse): MsgSetStablecoinMintCapResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinMintCapResponse", + value: MsgSetStablecoinMintCapResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetStablecoinInterestRate(): MsgSetStablecoinInterestRate { + return { + creator: "", + stablecoinInterestRate: "" + }; +} +export const MsgSetStablecoinInterestRate = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRate", + encode(message: MsgSetStablecoinInterestRate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.stablecoinInterestRate !== "") { + writer.uint32(18).string(message.stablecoinInterestRate); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetStablecoinInterestRate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetStablecoinInterestRate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.stablecoinInterestRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetStablecoinInterestRate { + const message = createBaseMsgSetStablecoinInterestRate(); + message.creator = object.creator ?? ""; + message.stablecoinInterestRate = object.stablecoinInterestRate ?? ""; + return message; + }, + fromAmino(object: MsgSetStablecoinInterestRateAmino): MsgSetStablecoinInterestRate { + const message = createBaseMsgSetStablecoinInterestRate(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.stablecoin_interest_rate !== undefined && object.stablecoin_interest_rate !== null) { + message.stablecoinInterestRate = object.stablecoin_interest_rate; + } + return message; + }, + toAmino(message: MsgSetStablecoinInterestRate, useInterfaces: boolean = false): MsgSetStablecoinInterestRateAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.stablecoin_interest_rate = message.stablecoinInterestRate === "" ? undefined : message.stablecoinInterestRate; + return obj; + }, + fromAminoMsg(object: MsgSetStablecoinInterestRateAminoMsg): MsgSetStablecoinInterestRate { + return MsgSetStablecoinInterestRate.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetStablecoinInterestRate, useInterfaces: boolean = false): MsgSetStablecoinInterestRateAminoMsg { + return { + type: "cdp/SetStablecoinInterestRate", + value: MsgSetStablecoinInterestRate.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetStablecoinInterestRateProtoMsg, useInterfaces: boolean = false): MsgSetStablecoinInterestRate { + return MsgSetStablecoinInterestRate.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetStablecoinInterestRate): Uint8Array { + return MsgSetStablecoinInterestRate.encode(message).finish(); + }, + toProtoMsg(message: MsgSetStablecoinInterestRate): MsgSetStablecoinInterestRateProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRate", + value: MsgSetStablecoinInterestRate.encode(message).finish() + }; + } +}; +function createBaseMsgSetStablecoinInterestRateResponse(): MsgSetStablecoinInterestRateResponse { + return {}; +} +export const MsgSetStablecoinInterestRateResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRateResponse", + encode(_: MsgSetStablecoinInterestRateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetStablecoinInterestRateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetStablecoinInterestRateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetStablecoinInterestRateResponse { + const message = createBaseMsgSetStablecoinInterestRateResponse(); + return message; + }, + fromAmino(_: MsgSetStablecoinInterestRateResponseAmino): MsgSetStablecoinInterestRateResponse { + const message = createBaseMsgSetStablecoinInterestRateResponse(); + return message; + }, + toAmino(_: MsgSetStablecoinInterestRateResponse, useInterfaces: boolean = false): MsgSetStablecoinInterestRateResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetStablecoinInterestRateResponseAminoMsg): MsgSetStablecoinInterestRateResponse { + return MsgSetStablecoinInterestRateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetStablecoinInterestRateResponseProtoMsg, useInterfaces: boolean = false): MsgSetStablecoinInterestRateResponse { + return MsgSetStablecoinInterestRateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetStablecoinInterestRateResponse): Uint8Array { + return MsgSetStablecoinInterestRateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetStablecoinInterestRateResponse): MsgSetStablecoinInterestRateResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStablecoinInterestRateResponse", + value: MsgSetStablecoinInterestRateResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMintStablecoin(): MsgMintStablecoin { + return { + creator: "", + amount: "" + }; +} +export const MsgMintStablecoin = { + typeUrl: "/Switcheo.carbon.cdp.MsgMintStablecoin", + encode(message: MsgMintStablecoin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgMintStablecoin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMintStablecoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMintStablecoin { + const message = createBaseMsgMintStablecoin(); + message.creator = object.creator ?? ""; + message.amount = object.amount ?? ""; + return message; + }, + fromAmino(object: MsgMintStablecoinAmino): MsgMintStablecoin { + const message = createBaseMsgMintStablecoin(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; + }, + toAmino(message: MsgMintStablecoin, useInterfaces: boolean = false): MsgMintStablecoinAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.amount = message.amount === "" ? undefined : message.amount; + return obj; + }, + fromAminoMsg(object: MsgMintStablecoinAminoMsg): MsgMintStablecoin { + return MsgMintStablecoin.fromAmino(object.value); + }, + toAminoMsg(message: MsgMintStablecoin, useInterfaces: boolean = false): MsgMintStablecoinAminoMsg { + return { + type: "cdp/MintStablecoin", + value: MsgMintStablecoin.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgMintStablecoinProtoMsg, useInterfaces: boolean = false): MsgMintStablecoin { + return MsgMintStablecoin.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgMintStablecoin): Uint8Array { + return MsgMintStablecoin.encode(message).finish(); + }, + toProtoMsg(message: MsgMintStablecoin): MsgMintStablecoinProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgMintStablecoin", + value: MsgMintStablecoin.encode(message).finish() + }; + } +}; +function createBaseMsgMintStablecoinResponse(): MsgMintStablecoinResponse { + return {}; +} +export const MsgMintStablecoinResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgMintStablecoinResponse", + encode(_: MsgMintStablecoinResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgMintStablecoinResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMintStablecoinResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgMintStablecoinResponse { + const message = createBaseMsgMintStablecoinResponse(); + return message; + }, + fromAmino(_: MsgMintStablecoinResponseAmino): MsgMintStablecoinResponse { + const message = createBaseMsgMintStablecoinResponse(); + return message; + }, + toAmino(_: MsgMintStablecoinResponse, useInterfaces: boolean = false): MsgMintStablecoinResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMintStablecoinResponseAminoMsg): MsgMintStablecoinResponse { + return MsgMintStablecoinResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgMintStablecoinResponseProtoMsg, useInterfaces: boolean = false): MsgMintStablecoinResponse { + return MsgMintStablecoinResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgMintStablecoinResponse): Uint8Array { + return MsgMintStablecoinResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMintStablecoinResponse): MsgMintStablecoinResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgMintStablecoinResponse", + value: MsgMintStablecoinResponse.encode(message).finish() + }; + } +}; +function createBaseMsgReturnStablecoin(): MsgReturnStablecoin { + return { + creator: "", + principal: Coin.fromPartial({}), + interest: Coin.fromPartial({}), + debtor: "", + principalFromCollateral: false, + interestFromCollateral: false + }; +} +export const MsgReturnStablecoin = { + typeUrl: "/Switcheo.carbon.cdp.MsgReturnStablecoin", + encode(message: MsgReturnStablecoin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.principal !== undefined) { + Coin.encode(message.principal, writer.uint32(18).fork()).ldelim(); + } + if (message.interest !== undefined) { + Coin.encode(message.interest, writer.uint32(26).fork()).ldelim(); + } + if (message.debtor !== "") { + writer.uint32(34).string(message.debtor); + } + if (message.principalFromCollateral === true) { + writer.uint32(40).bool(message.principalFromCollateral); + } + if (message.interestFromCollateral === true) { + writer.uint32(48).bool(message.interestFromCollateral); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgReturnStablecoin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReturnStablecoin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.principal = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.interest = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.debtor = reader.string(); + break; + case 5: + message.principalFromCollateral = reader.bool(); + break; + case 6: + message.interestFromCollateral = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgReturnStablecoin { + const message = createBaseMsgReturnStablecoin(); + message.creator = object.creator ?? ""; + message.principal = object.principal !== undefined && object.principal !== null ? Coin.fromPartial(object.principal) : undefined; + message.interest = object.interest !== undefined && object.interest !== null ? Coin.fromPartial(object.interest) : undefined; + message.debtor = object.debtor ?? ""; + message.principalFromCollateral = object.principalFromCollateral ?? false; + message.interestFromCollateral = object.interestFromCollateral ?? false; + return message; + }, + fromAmino(object: MsgReturnStablecoinAmino): MsgReturnStablecoin { + const message = createBaseMsgReturnStablecoin(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.principal !== undefined && object.principal !== null) { + message.principal = Coin.fromAmino(object.principal); + } + if (object.interest !== undefined && object.interest !== null) { + message.interest = Coin.fromAmino(object.interest); + } + if (object.debtor !== undefined && object.debtor !== null) { + message.debtor = object.debtor; + } + if (object.principal_from_collateral !== undefined && object.principal_from_collateral !== null) { + message.principalFromCollateral = object.principal_from_collateral; + } + if (object.interest_from_collateral !== undefined && object.interest_from_collateral !== null) { + message.interestFromCollateral = object.interest_from_collateral; + } + return message; + }, + toAmino(message: MsgReturnStablecoin, useInterfaces: boolean = false): MsgReturnStablecoinAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.principal = message.principal ? Coin.toAmino(message.principal, useInterfaces) : undefined; + obj.interest = message.interest ? Coin.toAmino(message.interest, useInterfaces) : undefined; + obj.debtor = message.debtor === "" ? undefined : message.debtor; + obj.principal_from_collateral = message.principalFromCollateral === false ? undefined : message.principalFromCollateral; + obj.interest_from_collateral = message.interestFromCollateral === false ? undefined : message.interestFromCollateral; + return obj; + }, + fromAminoMsg(object: MsgReturnStablecoinAminoMsg): MsgReturnStablecoin { + return MsgReturnStablecoin.fromAmino(object.value); + }, + toAminoMsg(message: MsgReturnStablecoin, useInterfaces: boolean = false): MsgReturnStablecoinAminoMsg { + return { + type: "cdp/ReturnStablecoin", + value: MsgReturnStablecoin.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgReturnStablecoinProtoMsg, useInterfaces: boolean = false): MsgReturnStablecoin { + return MsgReturnStablecoin.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgReturnStablecoin): Uint8Array { + return MsgReturnStablecoin.encode(message).finish(); + }, + toProtoMsg(message: MsgReturnStablecoin): MsgReturnStablecoinProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgReturnStablecoin", + value: MsgReturnStablecoin.encode(message).finish() + }; + } +}; +function createBaseMsgReturnStablecoinResponse(): MsgReturnStablecoinResponse { + return {}; +} +export const MsgReturnStablecoinResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgReturnStablecoinResponse", + encode(_: MsgReturnStablecoinResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgReturnStablecoinResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReturnStablecoinResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgReturnStablecoinResponse { + const message = createBaseMsgReturnStablecoinResponse(); + return message; + }, + fromAmino(_: MsgReturnStablecoinResponseAmino): MsgReturnStablecoinResponse { + const message = createBaseMsgReturnStablecoinResponse(); + return message; + }, + toAmino(_: MsgReturnStablecoinResponse, useInterfaces: boolean = false): MsgReturnStablecoinResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgReturnStablecoinResponseAminoMsg): MsgReturnStablecoinResponse { + return MsgReturnStablecoinResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgReturnStablecoinResponseProtoMsg, useInterfaces: boolean = false): MsgReturnStablecoinResponse { + return MsgReturnStablecoinResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgReturnStablecoinResponse): Uint8Array { + return MsgReturnStablecoinResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgReturnStablecoinResponse): MsgReturnStablecoinResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgReturnStablecoinResponse", + value: MsgReturnStablecoinResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetCompleteLiquidationThreshold(): MsgSetCompleteLiquidationThreshold { + return { + creator: "", + completeLiquidationThreshold: "" + }; +} +export const MsgSetCompleteLiquidationThreshold = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThreshold", + encode(message: MsgSetCompleteLiquidationThreshold, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.completeLiquidationThreshold !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.completeLiquidationThreshold, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetCompleteLiquidationThreshold { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetCompleteLiquidationThreshold(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.completeLiquidationThreshold = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetCompleteLiquidationThreshold { + const message = createBaseMsgSetCompleteLiquidationThreshold(); + message.creator = object.creator ?? ""; + message.completeLiquidationThreshold = object.completeLiquidationThreshold ?? ""; + return message; + }, + fromAmino(object: MsgSetCompleteLiquidationThresholdAmino): MsgSetCompleteLiquidationThreshold { + const message = createBaseMsgSetCompleteLiquidationThreshold(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.complete_liquidation_threshold !== undefined && object.complete_liquidation_threshold !== null) { + message.completeLiquidationThreshold = object.complete_liquidation_threshold; + } + return message; + }, + toAmino(message: MsgSetCompleteLiquidationThreshold, useInterfaces: boolean = false): MsgSetCompleteLiquidationThresholdAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.complete_liquidation_threshold = message.completeLiquidationThreshold === "" ? undefined : message.completeLiquidationThreshold; + return obj; + }, + fromAminoMsg(object: MsgSetCompleteLiquidationThresholdAminoMsg): MsgSetCompleteLiquidationThreshold { + return MsgSetCompleteLiquidationThreshold.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetCompleteLiquidationThreshold, useInterfaces: boolean = false): MsgSetCompleteLiquidationThresholdAminoMsg { + return { + type: "cdp/SetCompleteLiquidationThreshold", + value: MsgSetCompleteLiquidationThreshold.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetCompleteLiquidationThresholdProtoMsg, useInterfaces: boolean = false): MsgSetCompleteLiquidationThreshold { + return MsgSetCompleteLiquidationThreshold.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetCompleteLiquidationThreshold): Uint8Array { + return MsgSetCompleteLiquidationThreshold.encode(message).finish(); + }, + toProtoMsg(message: MsgSetCompleteLiquidationThreshold): MsgSetCompleteLiquidationThresholdProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThreshold", + value: MsgSetCompleteLiquidationThreshold.encode(message).finish() + }; + } +}; +function createBaseMsgSetCompleteLiquidationThresholdResponse(): MsgSetCompleteLiquidationThresholdResponse { + return {}; +} +export const MsgSetCompleteLiquidationThresholdResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThresholdResponse", + encode(_: MsgSetCompleteLiquidationThresholdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetCompleteLiquidationThresholdResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetCompleteLiquidationThresholdResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetCompleteLiquidationThresholdResponse { + const message = createBaseMsgSetCompleteLiquidationThresholdResponse(); + return message; + }, + fromAmino(_: MsgSetCompleteLiquidationThresholdResponseAmino): MsgSetCompleteLiquidationThresholdResponse { + const message = createBaseMsgSetCompleteLiquidationThresholdResponse(); + return message; + }, + toAmino(_: MsgSetCompleteLiquidationThresholdResponse, useInterfaces: boolean = false): MsgSetCompleteLiquidationThresholdResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetCompleteLiquidationThresholdResponseAminoMsg): MsgSetCompleteLiquidationThresholdResponse { + return MsgSetCompleteLiquidationThresholdResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetCompleteLiquidationThresholdResponseProtoMsg, useInterfaces: boolean = false): MsgSetCompleteLiquidationThresholdResponse { + return MsgSetCompleteLiquidationThresholdResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetCompleteLiquidationThresholdResponse): Uint8Array { + return MsgSetCompleteLiquidationThresholdResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetCompleteLiquidationThresholdResponse): MsgSetCompleteLiquidationThresholdResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCompleteLiquidationThresholdResponse", + value: MsgSetCompleteLiquidationThresholdResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetMinimumCloseFactor(): MsgSetMinimumCloseFactor { + return { + creator: "", + minimumCloseFactor: "" + }; +} +export const MsgSetMinimumCloseFactor = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactor", + encode(message: MsgSetMinimumCloseFactor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.minimumCloseFactor !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.minimumCloseFactor, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetMinimumCloseFactor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMinimumCloseFactor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.minimumCloseFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetMinimumCloseFactor { + const message = createBaseMsgSetMinimumCloseFactor(); + message.creator = object.creator ?? ""; + message.minimumCloseFactor = object.minimumCloseFactor ?? ""; + return message; + }, + fromAmino(object: MsgSetMinimumCloseFactorAmino): MsgSetMinimumCloseFactor { + const message = createBaseMsgSetMinimumCloseFactor(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.minimum_close_factor !== undefined && object.minimum_close_factor !== null) { + message.minimumCloseFactor = object.minimum_close_factor; + } + return message; + }, + toAmino(message: MsgSetMinimumCloseFactor, useInterfaces: boolean = false): MsgSetMinimumCloseFactorAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.minimum_close_factor = message.minimumCloseFactor === "" ? undefined : message.minimumCloseFactor; + return obj; + }, + fromAminoMsg(object: MsgSetMinimumCloseFactorAminoMsg): MsgSetMinimumCloseFactor { + return MsgSetMinimumCloseFactor.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetMinimumCloseFactor, useInterfaces: boolean = false): MsgSetMinimumCloseFactorAminoMsg { + return { + type: "cdp/SetMinimumCloseFactor", + value: MsgSetMinimumCloseFactor.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetMinimumCloseFactorProtoMsg, useInterfaces: boolean = false): MsgSetMinimumCloseFactor { + return MsgSetMinimumCloseFactor.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetMinimumCloseFactor): Uint8Array { + return MsgSetMinimumCloseFactor.encode(message).finish(); + }, + toProtoMsg(message: MsgSetMinimumCloseFactor): MsgSetMinimumCloseFactorProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactor", + value: MsgSetMinimumCloseFactor.encode(message).finish() + }; + } +}; +function createBaseMsgSetMinimumCloseFactorResponse(): MsgSetMinimumCloseFactorResponse { + return {}; +} +export const MsgSetMinimumCloseFactorResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactorResponse", + encode(_: MsgSetMinimumCloseFactorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetMinimumCloseFactorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMinimumCloseFactorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetMinimumCloseFactorResponse { + const message = createBaseMsgSetMinimumCloseFactorResponse(); + return message; + }, + fromAmino(_: MsgSetMinimumCloseFactorResponseAmino): MsgSetMinimumCloseFactorResponse { + const message = createBaseMsgSetMinimumCloseFactorResponse(); + return message; + }, + toAmino(_: MsgSetMinimumCloseFactorResponse, useInterfaces: boolean = false): MsgSetMinimumCloseFactorResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetMinimumCloseFactorResponseAminoMsg): MsgSetMinimumCloseFactorResponse { + return MsgSetMinimumCloseFactorResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetMinimumCloseFactorResponseProtoMsg, useInterfaces: boolean = false): MsgSetMinimumCloseFactorResponse { + return MsgSetMinimumCloseFactorResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetMinimumCloseFactorResponse): Uint8Array { + return MsgSetMinimumCloseFactorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetMinimumCloseFactorResponse): MsgSetMinimumCloseFactorResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetMinimumCloseFactorResponse", + value: MsgSetMinimumCloseFactorResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetSmallLiquidationSize(): MsgSetSmallLiquidationSize { + return { + creator: "", + smallLiquidationSize: "" + }; +} +export const MsgSetSmallLiquidationSize = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSize", + encode(message: MsgSetSmallLiquidationSize, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.smallLiquidationSize !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.smallLiquidationSize, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetSmallLiquidationSize { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSmallLiquidationSize(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.smallLiquidationSize = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetSmallLiquidationSize { + const message = createBaseMsgSetSmallLiquidationSize(); + message.creator = object.creator ?? ""; + message.smallLiquidationSize = object.smallLiquidationSize ?? ""; + return message; + }, + fromAmino(object: MsgSetSmallLiquidationSizeAmino): MsgSetSmallLiquidationSize { + const message = createBaseMsgSetSmallLiquidationSize(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.small_liquidation_size !== undefined && object.small_liquidation_size !== null) { + message.smallLiquidationSize = object.small_liquidation_size; + } + return message; + }, + toAmino(message: MsgSetSmallLiquidationSize, useInterfaces: boolean = false): MsgSetSmallLiquidationSizeAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.small_liquidation_size = message.smallLiquidationSize === "" ? undefined : message.smallLiquidationSize; + return obj; + }, + fromAminoMsg(object: MsgSetSmallLiquidationSizeAminoMsg): MsgSetSmallLiquidationSize { + return MsgSetSmallLiquidationSize.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetSmallLiquidationSize, useInterfaces: boolean = false): MsgSetSmallLiquidationSizeAminoMsg { + return { + type: "cdp/SetSmallLiquidationSize", + value: MsgSetSmallLiquidationSize.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetSmallLiquidationSizeProtoMsg, useInterfaces: boolean = false): MsgSetSmallLiquidationSize { + return MsgSetSmallLiquidationSize.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetSmallLiquidationSize): Uint8Array { + return MsgSetSmallLiquidationSize.encode(message).finish(); + }, + toProtoMsg(message: MsgSetSmallLiquidationSize): MsgSetSmallLiquidationSizeProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSize", + value: MsgSetSmallLiquidationSize.encode(message).finish() + }; + } +}; +function createBaseMsgSetSmallLiquidationSizeResponse(): MsgSetSmallLiquidationSizeResponse { + return {}; +} +export const MsgSetSmallLiquidationSizeResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSizeResponse", + encode(_: MsgSetSmallLiquidationSizeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetSmallLiquidationSizeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSmallLiquidationSizeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetSmallLiquidationSizeResponse { + const message = createBaseMsgSetSmallLiquidationSizeResponse(); + return message; + }, + fromAmino(_: MsgSetSmallLiquidationSizeResponseAmino): MsgSetSmallLiquidationSizeResponse { + const message = createBaseMsgSetSmallLiquidationSizeResponse(); + return message; + }, + toAmino(_: MsgSetSmallLiquidationSizeResponse, useInterfaces: boolean = false): MsgSetSmallLiquidationSizeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetSmallLiquidationSizeResponseAminoMsg): MsgSetSmallLiquidationSizeResponse { + return MsgSetSmallLiquidationSizeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetSmallLiquidationSizeResponseProtoMsg, useInterfaces: boolean = false): MsgSetSmallLiquidationSizeResponse { + return MsgSetSmallLiquidationSizeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetSmallLiquidationSizeResponse): Uint8Array { + return MsgSetSmallLiquidationSizeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetSmallLiquidationSizeResponse): MsgSetSmallLiquidationSizeResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetSmallLiquidationSizeResponse", + value: MsgSetSmallLiquidationSizeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCreateRewardScheme(): MsgCreateRewardScheme { + return { + creator: "", + createRewardSchemeParams: CreateRewardSchemeParams.fromPartial({}) + }; +} +export const MsgCreateRewardScheme = { + typeUrl: "/Switcheo.carbon.cdp.MsgCreateRewardScheme", + encode(message: MsgCreateRewardScheme, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.createRewardSchemeParams !== undefined) { + CreateRewardSchemeParams.encode(message.createRewardSchemeParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCreateRewardScheme { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateRewardScheme(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.createRewardSchemeParams = CreateRewardSchemeParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateRewardScheme { + const message = createBaseMsgCreateRewardScheme(); + message.creator = object.creator ?? ""; + message.createRewardSchemeParams = object.createRewardSchemeParams !== undefined && object.createRewardSchemeParams !== null ? CreateRewardSchemeParams.fromPartial(object.createRewardSchemeParams) : undefined; + return message; + }, + fromAmino(object: MsgCreateRewardSchemeAmino): MsgCreateRewardScheme { + const message = createBaseMsgCreateRewardScheme(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.create_reward_scheme_params !== undefined && object.create_reward_scheme_params !== null) { + message.createRewardSchemeParams = CreateRewardSchemeParams.fromAmino(object.create_reward_scheme_params); + } + return message; + }, + toAmino(message: MsgCreateRewardScheme, useInterfaces: boolean = false): MsgCreateRewardSchemeAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.create_reward_scheme_params = message.createRewardSchemeParams ? CreateRewardSchemeParams.toAmino(message.createRewardSchemeParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateRewardSchemeAminoMsg): MsgCreateRewardScheme { + return MsgCreateRewardScheme.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateRewardScheme, useInterfaces: boolean = false): MsgCreateRewardSchemeAminoMsg { + return { + type: "cdp/CreateRewardScheme", + value: MsgCreateRewardScheme.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgCreateRewardSchemeProtoMsg, useInterfaces: boolean = false): MsgCreateRewardScheme { + return MsgCreateRewardScheme.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgCreateRewardScheme): Uint8Array { + return MsgCreateRewardScheme.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateRewardScheme): MsgCreateRewardSchemeProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgCreateRewardScheme", + value: MsgCreateRewardScheme.encode(message).finish() + }; + } +}; +function createBaseMsgCreateRewardSchemeResponse(): MsgCreateRewardSchemeResponse { + return {}; +} +export const MsgCreateRewardSchemeResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgCreateRewardSchemeResponse", + encode(_: MsgCreateRewardSchemeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCreateRewardSchemeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateRewardSchemeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateRewardSchemeResponse { + const message = createBaseMsgCreateRewardSchemeResponse(); + return message; + }, + fromAmino(_: MsgCreateRewardSchemeResponseAmino): MsgCreateRewardSchemeResponse { + const message = createBaseMsgCreateRewardSchemeResponse(); + return message; + }, + toAmino(_: MsgCreateRewardSchemeResponse, useInterfaces: boolean = false): MsgCreateRewardSchemeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateRewardSchemeResponseAminoMsg): MsgCreateRewardSchemeResponse { + return MsgCreateRewardSchemeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateRewardSchemeResponseProtoMsg, useInterfaces: boolean = false): MsgCreateRewardSchemeResponse { + return MsgCreateRewardSchemeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgCreateRewardSchemeResponse): Uint8Array { + return MsgCreateRewardSchemeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateRewardSchemeResponse): MsgCreateRewardSchemeResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgCreateRewardSchemeResponse", + value: MsgCreateRewardSchemeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateRewardScheme(): MsgUpdateRewardScheme { + return { + updater: "", + updateRewardSchemeParams: UpdateRewardSchemeParams.fromPartial({}) + }; +} +export const MsgUpdateRewardScheme = { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRewardScheme", + encode(message: MsgUpdateRewardScheme, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.updater !== "") { + writer.uint32(10).string(message.updater); + } + if (message.updateRewardSchemeParams !== undefined) { + UpdateRewardSchemeParams.encode(message.updateRewardSchemeParams, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateRewardScheme { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateRewardScheme(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updater = reader.string(); + break; + case 2: + message.updateRewardSchemeParams = UpdateRewardSchemeParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateRewardScheme { + const message = createBaseMsgUpdateRewardScheme(); + message.updater = object.updater ?? ""; + message.updateRewardSchemeParams = object.updateRewardSchemeParams !== undefined && object.updateRewardSchemeParams !== null ? UpdateRewardSchemeParams.fromPartial(object.updateRewardSchemeParams) : undefined; + return message; + }, + fromAmino(object: MsgUpdateRewardSchemeAmino): MsgUpdateRewardScheme { + const message = createBaseMsgUpdateRewardScheme(); + if (object.updater !== undefined && object.updater !== null) { + message.updater = object.updater; + } + if (object.update_reward_scheme_params !== undefined && object.update_reward_scheme_params !== null) { + message.updateRewardSchemeParams = UpdateRewardSchemeParams.fromAmino(object.update_reward_scheme_params); + } + return message; + }, + toAmino(message: MsgUpdateRewardScheme, useInterfaces: boolean = false): MsgUpdateRewardSchemeAmino { + const obj: any = {}; + obj.updater = message.updater === "" ? undefined : message.updater; + obj.update_reward_scheme_params = message.updateRewardSchemeParams ? UpdateRewardSchemeParams.toAmino(message.updateRewardSchemeParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateRewardSchemeAminoMsg): MsgUpdateRewardScheme { + return MsgUpdateRewardScheme.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateRewardScheme, useInterfaces: boolean = false): MsgUpdateRewardSchemeAminoMsg { + return { + type: "cdp/UpdateRewardScheme", + value: MsgUpdateRewardScheme.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateRewardSchemeProtoMsg, useInterfaces: boolean = false): MsgUpdateRewardScheme { + return MsgUpdateRewardScheme.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateRewardScheme): Uint8Array { + return MsgUpdateRewardScheme.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateRewardScheme): MsgUpdateRewardSchemeProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRewardScheme", + value: MsgUpdateRewardScheme.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateRewardSchemeResponse(): MsgUpdateRewardSchemeResponse { + return {}; +} +export const MsgUpdateRewardSchemeResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRewardSchemeResponse", + encode(_: MsgUpdateRewardSchemeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateRewardSchemeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateRewardSchemeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateRewardSchemeResponse { + const message = createBaseMsgUpdateRewardSchemeResponse(); + return message; + }, + fromAmino(_: MsgUpdateRewardSchemeResponseAmino): MsgUpdateRewardSchemeResponse { + const message = createBaseMsgUpdateRewardSchemeResponse(); + return message; + }, + toAmino(_: MsgUpdateRewardSchemeResponse, useInterfaces: boolean = false): MsgUpdateRewardSchemeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateRewardSchemeResponseAminoMsg): MsgUpdateRewardSchemeResponse { + return MsgUpdateRewardSchemeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateRewardSchemeResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateRewardSchemeResponse { + return MsgUpdateRewardSchemeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateRewardSchemeResponse): Uint8Array { + return MsgUpdateRewardSchemeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateRewardSchemeResponse): MsgUpdateRewardSchemeResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateRewardSchemeResponse", + value: MsgUpdateRewardSchemeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgClaimRewards(): MsgClaimRewards { + return { + creator: "" + }; +} +export const MsgClaimRewards = { + typeUrl: "/Switcheo.carbon.cdp.MsgClaimRewards", + encode(message: MsgClaimRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgClaimRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClaimRewards(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgClaimRewards { + const message = createBaseMsgClaimRewards(); + message.creator = object.creator ?? ""; + return message; + }, + fromAmino(object: MsgClaimRewardsAmino): MsgClaimRewards { + const message = createBaseMsgClaimRewards(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + return message; + }, + toAmino(message: MsgClaimRewards, useInterfaces: boolean = false): MsgClaimRewardsAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + return obj; + }, + fromAminoMsg(object: MsgClaimRewardsAminoMsg): MsgClaimRewards { + return MsgClaimRewards.fromAmino(object.value); + }, + toAminoMsg(message: MsgClaimRewards, useInterfaces: boolean = false): MsgClaimRewardsAminoMsg { + return { + type: "cdp/ClaimRewards", + value: MsgClaimRewards.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgClaimRewardsProtoMsg, useInterfaces: boolean = false): MsgClaimRewards { + return MsgClaimRewards.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgClaimRewards): Uint8Array { + return MsgClaimRewards.encode(message).finish(); + }, + toProtoMsg(message: MsgClaimRewards): MsgClaimRewardsProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgClaimRewards", + value: MsgClaimRewards.encode(message).finish() + }; + } +}; +function createBaseMsgClaimRewardsResponse(): MsgClaimRewardsResponse { + return {}; +} +export const MsgClaimRewardsResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgClaimRewardsResponse", + encode(_: MsgClaimRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgClaimRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClaimRewardsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgClaimRewardsResponse { + const message = createBaseMsgClaimRewardsResponse(); + return message; + }, + fromAmino(_: MsgClaimRewardsResponseAmino): MsgClaimRewardsResponse { + const message = createBaseMsgClaimRewardsResponse(); + return message; + }, + toAmino(_: MsgClaimRewardsResponse, useInterfaces: boolean = false): MsgClaimRewardsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgClaimRewardsResponseAminoMsg): MsgClaimRewardsResponse { + return MsgClaimRewardsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgClaimRewardsResponseProtoMsg, useInterfaces: boolean = false): MsgClaimRewardsResponse { + return MsgClaimRewardsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgClaimRewardsResponse): Uint8Array { + return MsgClaimRewardsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgClaimRewardsResponse): MsgClaimRewardsResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgClaimRewardsResponse", + value: MsgClaimRewardsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetStalePriceGracePeriod(): MsgSetStalePriceGracePeriod { + return { + creator: "", + stalePriceGracePeriod: Duration.fromPartial({}) + }; +} +export const MsgSetStalePriceGracePeriod = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriod", + encode(message: MsgSetStalePriceGracePeriod, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.stalePriceGracePeriod !== undefined) { + Duration.encode(message.stalePriceGracePeriod, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetStalePriceGracePeriod { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetStalePriceGracePeriod(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.stalePriceGracePeriod = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetStalePriceGracePeriod { + const message = createBaseMsgSetStalePriceGracePeriod(); + message.creator = object.creator ?? ""; + message.stalePriceGracePeriod = object.stalePriceGracePeriod !== undefined && object.stalePriceGracePeriod !== null ? Duration.fromPartial(object.stalePriceGracePeriod) : undefined; + return message; + }, + fromAmino(object: MsgSetStalePriceGracePeriodAmino): MsgSetStalePriceGracePeriod { + const message = createBaseMsgSetStalePriceGracePeriod(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.stale_price_grace_period !== undefined && object.stale_price_grace_period !== null) { + message.stalePriceGracePeriod = Duration.fromAmino(object.stale_price_grace_period); + } + return message; + }, + toAmino(message: MsgSetStalePriceGracePeriod, useInterfaces: boolean = false): MsgSetStalePriceGracePeriodAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.stale_price_grace_period = message.stalePriceGracePeriod ? Duration.toAmino(message.stalePriceGracePeriod, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetStalePriceGracePeriodAminoMsg): MsgSetStalePriceGracePeriod { + return MsgSetStalePriceGracePeriod.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetStalePriceGracePeriod, useInterfaces: boolean = false): MsgSetStalePriceGracePeriodAminoMsg { + return { + type: "cdp/SetStalePriceGracePeriod", + value: MsgSetStalePriceGracePeriod.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetStalePriceGracePeriodProtoMsg, useInterfaces: boolean = false): MsgSetStalePriceGracePeriod { + return MsgSetStalePriceGracePeriod.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetStalePriceGracePeriod): Uint8Array { + return MsgSetStalePriceGracePeriod.encode(message).finish(); + }, + toProtoMsg(message: MsgSetStalePriceGracePeriod): MsgSetStalePriceGracePeriodProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriod", + value: MsgSetStalePriceGracePeriod.encode(message).finish() + }; + } +}; +function createBaseMsgSetStalePriceGracePeriodResponse(): MsgSetStalePriceGracePeriodResponse { + return {}; +} +export const MsgSetStalePriceGracePeriodResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriodResponse", + encode(_: MsgSetStalePriceGracePeriodResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetStalePriceGracePeriodResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetStalePriceGracePeriodResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetStalePriceGracePeriodResponse { + const message = createBaseMsgSetStalePriceGracePeriodResponse(); + return message; + }, + fromAmino(_: MsgSetStalePriceGracePeriodResponseAmino): MsgSetStalePriceGracePeriodResponse { + const message = createBaseMsgSetStalePriceGracePeriodResponse(); + return message; + }, + toAmino(_: MsgSetStalePriceGracePeriodResponse, useInterfaces: boolean = false): MsgSetStalePriceGracePeriodResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetStalePriceGracePeriodResponseAminoMsg): MsgSetStalePriceGracePeriodResponse { + return MsgSetStalePriceGracePeriodResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetStalePriceGracePeriodResponseProtoMsg, useInterfaces: boolean = false): MsgSetStalePriceGracePeriodResponse { + return MsgSetStalePriceGracePeriodResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetStalePriceGracePeriodResponse): Uint8Array { + return MsgSetStalePriceGracePeriodResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetStalePriceGracePeriodResponse): MsgSetStalePriceGracePeriodResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetStalePriceGracePeriodResponse", + value: MsgSetStalePriceGracePeriodResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetCdpPaused(): MsgSetCdpPaused { + return { + creator: "", + cdpPaused: false + }; +} +export const MsgSetCdpPaused = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCdpPaused", + encode(message: MsgSetCdpPaused, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.cdpPaused === true) { + writer.uint32(16).bool(message.cdpPaused); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetCdpPaused { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetCdpPaused(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.cdpPaused = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetCdpPaused { + const message = createBaseMsgSetCdpPaused(); + message.creator = object.creator ?? ""; + message.cdpPaused = object.cdpPaused ?? false; + return message; + }, + fromAmino(object: MsgSetCdpPausedAmino): MsgSetCdpPaused { + const message = createBaseMsgSetCdpPaused(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.cdpPaused !== undefined && object.cdpPaused !== null) { + message.cdpPaused = object.cdpPaused; + } + return message; + }, + toAmino(message: MsgSetCdpPaused, useInterfaces: boolean = false): MsgSetCdpPausedAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.cdpPaused = message.cdpPaused === false ? undefined : message.cdpPaused; + return obj; + }, + fromAminoMsg(object: MsgSetCdpPausedAminoMsg): MsgSetCdpPaused { + return MsgSetCdpPaused.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetCdpPaused, useInterfaces: boolean = false): MsgSetCdpPausedAminoMsg { + return { + type: "cdp/SetCdpPaused", + value: MsgSetCdpPaused.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetCdpPausedProtoMsg, useInterfaces: boolean = false): MsgSetCdpPaused { + return MsgSetCdpPaused.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetCdpPaused): Uint8Array { + return MsgSetCdpPaused.encode(message).finish(); + }, + toProtoMsg(message: MsgSetCdpPaused): MsgSetCdpPausedProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCdpPaused", + value: MsgSetCdpPaused.encode(message).finish() + }; + } +}; +function createBaseMsgSetCdpPausedResponse(): MsgSetCdpPausedResponse { + return {}; +} +export const MsgSetCdpPausedResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCdpPausedResponse", + encode(_: MsgSetCdpPausedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetCdpPausedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetCdpPausedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetCdpPausedResponse { + const message = createBaseMsgSetCdpPausedResponse(); + return message; + }, + fromAmino(_: MsgSetCdpPausedResponseAmino): MsgSetCdpPausedResponse { + const message = createBaseMsgSetCdpPausedResponse(); + return message; + }, + toAmino(_: MsgSetCdpPausedResponse, useInterfaces: boolean = false): MsgSetCdpPausedResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetCdpPausedResponseAminoMsg): MsgSetCdpPausedResponse { + return MsgSetCdpPausedResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetCdpPausedResponseProtoMsg, useInterfaces: boolean = false): MsgSetCdpPausedResponse { + return MsgSetCdpPausedResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetCdpPausedResponse): Uint8Array { + return MsgSetCdpPausedResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetCdpPausedResponse): MsgSetCdpPausedResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetCdpPausedResponse", + value: MsgSetCdpPausedResponse.encode(message).finish() + }; + } +}; +function createBaseMsgConvertTokenInCdpToGroupTokens(): MsgConvertTokenInCdpToGroupTokens { + return { + creator: "", + denom: "" + }; +} +export const MsgConvertTokenInCdpToGroupTokens = { + typeUrl: "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokens", + encode(message: MsgConvertTokenInCdpToGroupTokens, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgConvertTokenInCdpToGroupTokens { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConvertTokenInCdpToGroupTokens(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgConvertTokenInCdpToGroupTokens { + const message = createBaseMsgConvertTokenInCdpToGroupTokens(); + message.creator = object.creator ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: MsgConvertTokenInCdpToGroupTokensAmino): MsgConvertTokenInCdpToGroupTokens { + const message = createBaseMsgConvertTokenInCdpToGroupTokens(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: MsgConvertTokenInCdpToGroupTokens, useInterfaces: boolean = false): MsgConvertTokenInCdpToGroupTokensAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: MsgConvertTokenInCdpToGroupTokensAminoMsg): MsgConvertTokenInCdpToGroupTokens { + return MsgConvertTokenInCdpToGroupTokens.fromAmino(object.value); + }, + toAminoMsg(message: MsgConvertTokenInCdpToGroupTokens, useInterfaces: boolean = false): MsgConvertTokenInCdpToGroupTokensAminoMsg { + return { + type: "cdp/ConvertTokenInCdpToGroupTokens", + value: MsgConvertTokenInCdpToGroupTokens.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgConvertTokenInCdpToGroupTokensProtoMsg, useInterfaces: boolean = false): MsgConvertTokenInCdpToGroupTokens { + return MsgConvertTokenInCdpToGroupTokens.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgConvertTokenInCdpToGroupTokens): Uint8Array { + return MsgConvertTokenInCdpToGroupTokens.encode(message).finish(); + }, + toProtoMsg(message: MsgConvertTokenInCdpToGroupTokens): MsgConvertTokenInCdpToGroupTokensProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokens", + value: MsgConvertTokenInCdpToGroupTokens.encode(message).finish() + }; + } +}; +function createBaseMsgConvertTokenInCdpToGroupTokensResponse(): MsgConvertTokenInCdpToGroupTokensResponse { + return {}; +} +export const MsgConvertTokenInCdpToGroupTokensResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokensResponse", + encode(_: MsgConvertTokenInCdpToGroupTokensResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgConvertTokenInCdpToGroupTokensResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConvertTokenInCdpToGroupTokensResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgConvertTokenInCdpToGroupTokensResponse { + const message = createBaseMsgConvertTokenInCdpToGroupTokensResponse(); + return message; + }, + fromAmino(_: MsgConvertTokenInCdpToGroupTokensResponseAmino): MsgConvertTokenInCdpToGroupTokensResponse { + const message = createBaseMsgConvertTokenInCdpToGroupTokensResponse(); + return message; + }, + toAmino(_: MsgConvertTokenInCdpToGroupTokensResponse, useInterfaces: boolean = false): MsgConvertTokenInCdpToGroupTokensResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConvertTokenInCdpToGroupTokensResponseAminoMsg): MsgConvertTokenInCdpToGroupTokensResponse { + return MsgConvertTokenInCdpToGroupTokensResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgConvertTokenInCdpToGroupTokensResponseProtoMsg, useInterfaces: boolean = false): MsgConvertTokenInCdpToGroupTokensResponse { + return MsgConvertTokenInCdpToGroupTokensResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgConvertTokenInCdpToGroupTokensResponse): Uint8Array { + return MsgConvertTokenInCdpToGroupTokensResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConvertTokenInCdpToGroupTokensResponse): MsgConvertTokenInCdpToGroupTokensResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgConvertTokenInCdpToGroupTokensResponse", + value: MsgConvertTokenInCdpToGroupTokensResponse.encode(message).finish() + }; + } +}; +function createBaseMsgAddEModeCategory(): MsgAddEModeCategory { + return { + creator: "", + eModeCategory: EModeCategory.fromPartial({}) + }; +} +export const MsgAddEModeCategory = { + typeUrl: "/Switcheo.carbon.cdp.MsgAddEModeCategory", + encode(message: MsgAddEModeCategory, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.eModeCategory !== undefined) { + EModeCategory.encode(message.eModeCategory, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAddEModeCategory { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddEModeCategory(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.eModeCategory = EModeCategory.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddEModeCategory { + const message = createBaseMsgAddEModeCategory(); + message.creator = object.creator ?? ""; + message.eModeCategory = object.eModeCategory !== undefined && object.eModeCategory !== null ? EModeCategory.fromPartial(object.eModeCategory) : undefined; + return message; + }, + fromAmino(object: MsgAddEModeCategoryAmino): MsgAddEModeCategory { + const message = createBaseMsgAddEModeCategory(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.e_mode_category !== undefined && object.e_mode_category !== null) { + message.eModeCategory = EModeCategory.fromAmino(object.e_mode_category); + } + return message; + }, + toAmino(message: MsgAddEModeCategory, useInterfaces: boolean = false): MsgAddEModeCategoryAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.e_mode_category = message.eModeCategory ? EModeCategory.toAmino(message.eModeCategory, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgAddEModeCategoryAminoMsg): MsgAddEModeCategory { + return MsgAddEModeCategory.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddEModeCategory, useInterfaces: boolean = false): MsgAddEModeCategoryAminoMsg { + return { + type: "cdp/AddEModeCategory", + value: MsgAddEModeCategory.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgAddEModeCategoryProtoMsg, useInterfaces: boolean = false): MsgAddEModeCategory { + return MsgAddEModeCategory.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAddEModeCategory): Uint8Array { + return MsgAddEModeCategory.encode(message).finish(); + }, + toProtoMsg(message: MsgAddEModeCategory): MsgAddEModeCategoryProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddEModeCategory", + value: MsgAddEModeCategory.encode(message).finish() + }; + } +}; +function createBaseMsgAddEModeCategoryResponse(): MsgAddEModeCategoryResponse { + return {}; +} +export const MsgAddEModeCategoryResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgAddEModeCategoryResponse", + encode(_: MsgAddEModeCategoryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAddEModeCategoryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddEModeCategoryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAddEModeCategoryResponse { + const message = createBaseMsgAddEModeCategoryResponse(); + return message; + }, + fromAmino(_: MsgAddEModeCategoryResponseAmino): MsgAddEModeCategoryResponse { + const message = createBaseMsgAddEModeCategoryResponse(); + return message; + }, + toAmino(_: MsgAddEModeCategoryResponse, useInterfaces: boolean = false): MsgAddEModeCategoryResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAddEModeCategoryResponseAminoMsg): MsgAddEModeCategoryResponse { + return MsgAddEModeCategoryResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAddEModeCategoryResponseProtoMsg, useInterfaces: boolean = false): MsgAddEModeCategoryResponse { + return MsgAddEModeCategoryResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAddEModeCategoryResponse): Uint8Array { + return MsgAddEModeCategoryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddEModeCategoryResponse): MsgAddEModeCategoryResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgAddEModeCategoryResponse", + value: MsgAddEModeCategoryResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateEModeCategory(): MsgUpdateEModeCategory { + return { + creator: "", + eModeCategoryName: "", + updateEModeCategoryParams: UpdateEModeCategoryParams.fromPartial({}) + }; +} +export const MsgUpdateEModeCategory = { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateEModeCategory", + encode(message: MsgUpdateEModeCategory, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.eModeCategoryName !== "") { + writer.uint32(18).string(message.eModeCategoryName); + } + if (message.updateEModeCategoryParams !== undefined) { + UpdateEModeCategoryParams.encode(message.updateEModeCategoryParams, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateEModeCategory { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateEModeCategory(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.eModeCategoryName = reader.string(); + break; + case 3: + message.updateEModeCategoryParams = UpdateEModeCategoryParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateEModeCategory { + const message = createBaseMsgUpdateEModeCategory(); + message.creator = object.creator ?? ""; + message.eModeCategoryName = object.eModeCategoryName ?? ""; + message.updateEModeCategoryParams = object.updateEModeCategoryParams !== undefined && object.updateEModeCategoryParams !== null ? UpdateEModeCategoryParams.fromPartial(object.updateEModeCategoryParams) : undefined; + return message; + }, + fromAmino(object: MsgUpdateEModeCategoryAmino): MsgUpdateEModeCategory { + const message = createBaseMsgUpdateEModeCategory(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.e_mode_category_name !== undefined && object.e_mode_category_name !== null) { + message.eModeCategoryName = object.e_mode_category_name; + } + if (object.update_e_mode_category_params !== undefined && object.update_e_mode_category_params !== null) { + message.updateEModeCategoryParams = UpdateEModeCategoryParams.fromAmino(object.update_e_mode_category_params); + } + return message; + }, + toAmino(message: MsgUpdateEModeCategory, useInterfaces: boolean = false): MsgUpdateEModeCategoryAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.e_mode_category_name = message.eModeCategoryName === "" ? undefined : message.eModeCategoryName; + obj.update_e_mode_category_params = message.updateEModeCategoryParams ? UpdateEModeCategoryParams.toAmino(message.updateEModeCategoryParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateEModeCategoryAminoMsg): MsgUpdateEModeCategory { + return MsgUpdateEModeCategory.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateEModeCategory, useInterfaces: boolean = false): MsgUpdateEModeCategoryAminoMsg { + return { + type: "cdp/UpdateEModeCategory", + value: MsgUpdateEModeCategory.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateEModeCategoryProtoMsg, useInterfaces: boolean = false): MsgUpdateEModeCategory { + return MsgUpdateEModeCategory.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateEModeCategory): Uint8Array { + return MsgUpdateEModeCategory.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateEModeCategory): MsgUpdateEModeCategoryProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateEModeCategory", + value: MsgUpdateEModeCategory.encode(message).finish() + }; + } +}; +function createBaseUpdateEModeCategoryParams(): UpdateEModeCategoryParams { + return { + denoms: [], + loanToValue: undefined, + liquidationThreshold: undefined, + liquidationDiscount: undefined, + isActive: undefined + }; +} +export const UpdateEModeCategoryParams = { + typeUrl: "/Switcheo.carbon.cdp.UpdateEModeCategoryParams", + encode(message: UpdateEModeCategoryParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denoms) { + StringValue.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.loanToValue !== undefined) { + Int64Value.encode(message.loanToValue, writer.uint32(18).fork()).ldelim(); + } + if (message.liquidationThreshold !== undefined) { + Int64Value.encode(message.liquidationThreshold, writer.uint32(26).fork()).ldelim(); + } + if (message.liquidationDiscount !== undefined) { + Int64Value.encode(message.liquidationDiscount, writer.uint32(34).fork()).ldelim(); + } + if (message.isActive !== undefined) { + BoolValue.encode(message.isActive, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UpdateEModeCategoryParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateEModeCategoryParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denoms.push(StringValue.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.loanToValue = Int64Value.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.liquidationThreshold = Int64Value.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.liquidationDiscount = Int64Value.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.isActive = BoolValue.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateEModeCategoryParams { + const message = createBaseUpdateEModeCategoryParams(); + message.denoms = object.denoms?.map(e => StringValue.fromPartial(e)) || []; + message.loanToValue = object.loanToValue !== undefined && object.loanToValue !== null ? Int64Value.fromPartial(object.loanToValue) : undefined; + message.liquidationThreshold = object.liquidationThreshold !== undefined && object.liquidationThreshold !== null ? Int64Value.fromPartial(object.liquidationThreshold) : undefined; + message.liquidationDiscount = object.liquidationDiscount !== undefined && object.liquidationDiscount !== null ? Int64Value.fromPartial(object.liquidationDiscount) : undefined; + message.isActive = object.isActive !== undefined && object.isActive !== null ? BoolValue.fromPartial(object.isActive) : undefined; + return message; + }, + fromAmino(object: UpdateEModeCategoryParamsAmino): UpdateEModeCategoryParams { + const message = createBaseUpdateEModeCategoryParams(); + message.denoms = object.denoms?.map(e => StringValue.fromAmino(e)) || []; + if (object.loan_to_value !== undefined && object.loan_to_value !== null) { + message.loanToValue = Int64Value.fromAmino(object.loan_to_value); + } + if (object.liquidation_threshold !== undefined && object.liquidation_threshold !== null) { + message.liquidationThreshold = Int64Value.fromAmino(object.liquidation_threshold); + } + if (object.liquidation_discount !== undefined && object.liquidation_discount !== null) { + message.liquidationDiscount = Int64Value.fromAmino(object.liquidation_discount); + } + if (object.is_active !== undefined && object.is_active !== null) { + message.isActive = BoolValue.fromAmino(object.is_active); + } + return message; + }, + toAmino(message: UpdateEModeCategoryParams, useInterfaces: boolean = false): UpdateEModeCategoryParamsAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e ? StringValue.toAmino(e, useInterfaces) : undefined); + } else { + obj.denoms = message.denoms; + } + obj.loan_to_value = message.loanToValue ? Int64Value.toAmino(message.loanToValue, useInterfaces) : undefined; + obj.liquidation_threshold = message.liquidationThreshold ? Int64Value.toAmino(message.liquidationThreshold, useInterfaces) : undefined; + obj.liquidation_discount = message.liquidationDiscount ? Int64Value.toAmino(message.liquidationDiscount, useInterfaces) : undefined; + obj.is_active = message.isActive ? BoolValue.toAmino(message.isActive, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: UpdateEModeCategoryParamsAminoMsg): UpdateEModeCategoryParams { + return UpdateEModeCategoryParams.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateEModeCategoryParamsProtoMsg, useInterfaces: boolean = false): UpdateEModeCategoryParams { + return UpdateEModeCategoryParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UpdateEModeCategoryParams): Uint8Array { + return UpdateEModeCategoryParams.encode(message).finish(); + }, + toProtoMsg(message: UpdateEModeCategoryParams): UpdateEModeCategoryParamsProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.UpdateEModeCategoryParams", + value: UpdateEModeCategoryParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateEModeCategoryResponse(): MsgUpdateEModeCategoryResponse { + return {}; +} +export const MsgUpdateEModeCategoryResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateEModeCategoryResponse", + encode(_: MsgUpdateEModeCategoryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateEModeCategoryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateEModeCategoryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateEModeCategoryResponse { + const message = createBaseMsgUpdateEModeCategoryResponse(); + return message; + }, + fromAmino(_: MsgUpdateEModeCategoryResponseAmino): MsgUpdateEModeCategoryResponse { + const message = createBaseMsgUpdateEModeCategoryResponse(); + return message; + }, + toAmino(_: MsgUpdateEModeCategoryResponse, useInterfaces: boolean = false): MsgUpdateEModeCategoryResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateEModeCategoryResponseAminoMsg): MsgUpdateEModeCategoryResponse { + return MsgUpdateEModeCategoryResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateEModeCategoryResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateEModeCategoryResponse { + return MsgUpdateEModeCategoryResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateEModeCategoryResponse): Uint8Array { + return MsgUpdateEModeCategoryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateEModeCategoryResponse): MsgUpdateEModeCategoryResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateEModeCategoryResponse", + value: MsgUpdateEModeCategoryResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetAccountEMode(): MsgSetAccountEMode { + return { + creator: "", + eModeCategoryName: "" + }; +} +export const MsgSetAccountEMode = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetAccountEMode", + encode(message: MsgSetAccountEMode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.eModeCategoryName !== "") { + writer.uint32(18).string(message.eModeCategoryName); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetAccountEMode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetAccountEMode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.eModeCategoryName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetAccountEMode { + const message = createBaseMsgSetAccountEMode(); + message.creator = object.creator ?? ""; + message.eModeCategoryName = object.eModeCategoryName ?? ""; + return message; + }, + fromAmino(object: MsgSetAccountEModeAmino): MsgSetAccountEMode { + const message = createBaseMsgSetAccountEMode(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.e_mode_category_name !== undefined && object.e_mode_category_name !== null) { + message.eModeCategoryName = object.e_mode_category_name; + } + return message; + }, + toAmino(message: MsgSetAccountEMode, useInterfaces: boolean = false): MsgSetAccountEModeAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + obj.e_mode_category_name = message.eModeCategoryName === "" ? undefined : message.eModeCategoryName; + return obj; + }, + fromAminoMsg(object: MsgSetAccountEModeAminoMsg): MsgSetAccountEMode { + return MsgSetAccountEMode.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetAccountEMode, useInterfaces: boolean = false): MsgSetAccountEModeAminoMsg { + return { + type: "cdp/SetAccountEMode", + value: MsgSetAccountEMode.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetAccountEModeProtoMsg, useInterfaces: boolean = false): MsgSetAccountEMode { + return MsgSetAccountEMode.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetAccountEMode): Uint8Array { + return MsgSetAccountEMode.encode(message).finish(); + }, + toProtoMsg(message: MsgSetAccountEMode): MsgSetAccountEModeProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetAccountEMode", + value: MsgSetAccountEMode.encode(message).finish() + }; + } +}; +function createBaseMsgSetAccountEModeResponse(): MsgSetAccountEModeResponse { + return {}; +} +export const MsgSetAccountEModeResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgSetAccountEModeResponse", + encode(_: MsgSetAccountEModeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetAccountEModeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetAccountEModeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetAccountEModeResponse { + const message = createBaseMsgSetAccountEModeResponse(); + return message; + }, + fromAmino(_: MsgSetAccountEModeResponseAmino): MsgSetAccountEModeResponse { + const message = createBaseMsgSetAccountEModeResponse(); + return message; + }, + toAmino(_: MsgSetAccountEModeResponse, useInterfaces: boolean = false): MsgSetAccountEModeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetAccountEModeResponseAminoMsg): MsgSetAccountEModeResponse { + return MsgSetAccountEModeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetAccountEModeResponseProtoMsg, useInterfaces: boolean = false): MsgSetAccountEModeResponse { + return MsgSetAccountEModeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetAccountEModeResponse): Uint8Array { + return MsgSetAccountEModeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetAccountEModeResponse): MsgSetAccountEModeResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgSetAccountEModeResponse", + value: MsgSetAccountEModeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveAccountEMode(): MsgRemoveAccountEMode { + return { + creator: "" + }; +} +export const MsgRemoveAccountEMode = { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveAccountEMode", + encode(message: MsgRemoveAccountEMode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRemoveAccountEMode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveAccountEMode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveAccountEMode { + const message = createBaseMsgRemoveAccountEMode(); + message.creator = object.creator ?? ""; + return message; + }, + fromAmino(object: MsgRemoveAccountEModeAmino): MsgRemoveAccountEMode { + const message = createBaseMsgRemoveAccountEMode(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + return message; + }, + toAmino(message: MsgRemoveAccountEMode, useInterfaces: boolean = false): MsgRemoveAccountEModeAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + return obj; + }, + fromAminoMsg(object: MsgRemoveAccountEModeAminoMsg): MsgRemoveAccountEMode { + return MsgRemoveAccountEMode.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveAccountEMode, useInterfaces: boolean = false): MsgRemoveAccountEModeAminoMsg { + return { + type: "cdp/RemoveAccountEMode", + value: MsgRemoveAccountEMode.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgRemoveAccountEModeProtoMsg, useInterfaces: boolean = false): MsgRemoveAccountEMode { + return MsgRemoveAccountEMode.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRemoveAccountEMode): Uint8Array { + return MsgRemoveAccountEMode.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveAccountEMode): MsgRemoveAccountEModeProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveAccountEMode", + value: MsgRemoveAccountEMode.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveAccountEModeResponse(): MsgRemoveAccountEModeResponse { + return {}; +} +export const MsgRemoveAccountEModeResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveAccountEModeResponse", + encode(_: MsgRemoveAccountEModeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRemoveAccountEModeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveAccountEModeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRemoveAccountEModeResponse { + const message = createBaseMsgRemoveAccountEModeResponse(); + return message; + }, + fromAmino(_: MsgRemoveAccountEModeResponseAmino): MsgRemoveAccountEModeResponse { + const message = createBaseMsgRemoveAccountEModeResponse(); + return message; + }, + toAmino(_: MsgRemoveAccountEModeResponse, useInterfaces: boolean = false): MsgRemoveAccountEModeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRemoveAccountEModeResponseAminoMsg): MsgRemoveAccountEModeResponse { + return MsgRemoveAccountEModeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRemoveAccountEModeResponseProtoMsg, useInterfaces: boolean = false): MsgRemoveAccountEModeResponse { + return MsgRemoveAccountEModeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRemoveAccountEModeResponse): Uint8Array { + return MsgRemoveAccountEModeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveAccountEModeResponse): MsgRemoveAccountEModeResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgRemoveAccountEModeResponse", + value: MsgRemoveAccountEModeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: ParamsToUpdate.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + ParamsToUpdate.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = ParamsToUpdate.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? ParamsToUpdate.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = ParamsToUpdate.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? ParamsToUpdate.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAminoMsg { + return { + type: "cdp/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg, useInterfaces: boolean = false): MsgUpdateParams { + return MsgUpdateParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/Switcheo.carbon.cdp.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/client.ts b/packages/types/protobuf/codegen/Switcheo/client.ts new file mode 100644 index 000000000..07d071498 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/client.ts @@ -0,0 +1,47 @@ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as switcheoCarbonCdpTxRegistry from "./carbon/cdp/tx.registry"; +import * as switcheoCarbonCdpTxAmino from "./carbon/cdp/tx.amino"; +export const switcheoAminoConverters = { + ...switcheoCarbonCdpTxAmino.AminoConverter +}; +export const switcheoProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...switcheoCarbonCdpTxRegistry.registry]; +export const getSigningSwitcheoClientOptions = ({ + defaultTypes = defaultRegistryTypes +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...switcheoProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...switcheoAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningSwitcheoClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningSwitcheoClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: (registry as any), + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/rpc.query.ts b/packages/types/protobuf/codegen/Switcheo/rpc.query.ts new file mode 100644 index 000000000..45d256ce0 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/rpc.query.ts @@ -0,0 +1,61 @@ +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + base: { + tendermint: { + v1beta1: (await import("../cosmos/base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) + } + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + slashing: { + v1beta1: (await import("../cosmos/slashing/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + Switcheo: { + carbon: { + cdp: (await import("./carbon/cdp/query.rpc.Query")).createRpcQueryExtension(client) + } + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/Switcheo/rpc.tx.ts b/packages/types/protobuf/codegen/Switcheo/rpc.tx.ts new file mode 100644 index 000000000..97db3c6b4 --- /dev/null +++ b/packages/types/protobuf/codegen/Switcheo/rpc.tx.ts @@ -0,0 +1,45 @@ +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + slashing: { + v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + Switcheo: { + carbon: { + cdp: new (await import("./carbon/cdp/tx.rpc.msg")).MsgClientImpl(rpc) + } + } +}); \ No newline at end of file diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index a2661286d..e3539e96e 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _396 from "./alliance/tx.amino"; -import * as _397 from "./alliance/tx.registry"; -import * as _398 from "./alliance/query.rpc.Query"; -import * as _399 from "./alliance/tx.rpc.msg"; -import * as _668 from "./rpc.query"; -import * as _669 from "./rpc.tx"; +import * as _410 from "./alliance/tx.amino"; +import * as _411 from "./alliance/tx.registry"; +import * as _412 from "./alliance/query.rpc.Query"; +import * as _413 from "./alliance/tx.rpc.msg"; +import * as _686 from "./rpc.query"; +import * as _687 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._396, - ..._397, - ..._398, - ..._399 + ..._410, + ..._411, + ..._412, + ..._413 }; export const ClientFactory = { - ..._668, - ..._669 + ..._686, + ..._687 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/bundle.ts b/packages/types/protobuf/codegen/bitsong/bundle.ts index 90ce31677..abc2a5314 100644 --- a/packages/types/protobuf/codegen/bitsong/bundle.ts +++ b/packages/types/protobuf/codegen/bitsong/bundle.ts @@ -1,22 +1,22 @@ import * as _11 from "./fantoken/v1beta1/tx"; -import * as _400 from "./fantoken/v1beta1/tx.amino"; -import * as _401 from "./fantoken/v1beta1/tx.registry"; -import * as _402 from "./fantoken/v1beta1/query.rpc.Query"; -import * as _403 from "./fantoken/v1beta1/tx.rpc.msg"; -import * as _670 from "./rpc.query"; -import * as _671 from "./rpc.tx"; +import * as _414 from "./fantoken/v1beta1/tx.amino"; +import * as _415 from "./fantoken/v1beta1/tx.registry"; +import * as _416 from "./fantoken/v1beta1/query.rpc.Query"; +import * as _417 from "./fantoken/v1beta1/tx.rpc.msg"; +import * as _688 from "./rpc.query"; +import * as _689 from "./rpc.tx"; export namespace bitsong { export const fantoken = { ..._11, - ..._400, - ..._401, - ..._403, + ..._414, + ..._415, + ..._417, v1beta1: { - ..._402 + ..._416 } }; export const ClientFactory = { - ..._670, - ..._671 + ..._688, + ..._689 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index e091415bc..dff762fcd 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _24 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _25 from "./cctp/v1/signature_threshold"; import * as _26 from "./cctp/v1/token_pair"; import * as _27 from "./cctp/v1/tx"; -import * as _404 from "./cctp/v1/tx.amino"; -import * as _405 from "./cctp/v1/tx.registry"; -import * as _406 from "./cctp/v1/query.rpc.Query"; -import * as _407 from "./cctp/v1/tx.rpc.msg"; -import * as _672 from "./rpc.query"; -import * as _673 from "./rpc.tx"; +import * as _418 from "./cctp/v1/tx.amino"; +import * as _419 from "./cctp/v1/tx.registry"; +import * as _420 from "./cctp/v1/query.rpc.Query"; +import * as _421 from "./cctp/v1/tx.rpc.msg"; +import * as _690 from "./rpc.query"; +import * as _691 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._25, ..._26, ..._27, - ..._404, - ..._405, - ..._406, - ..._407 + ..._418, + ..._419, + ..._420, + ..._421 }; } export const ClientFactory = { - ..._672, - ..._673 + ..._690, + ..._691 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index d675e99c0..404847686 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -62,55 +62,55 @@ import * as _89 from "./tx/v1beta1/tx"; import * as _90 from "./upgrade/v1beta1/query"; import * as _91 from "./upgrade/v1beta1/tx"; import * as _92 from "./upgrade/v1beta1/upgrade"; -import * as _408 from "./auth/v1beta1/tx.amino"; -import * as _409 from "./authz/v1beta1/tx.amino"; -import * as _410 from "./bank/v1beta1/tx.amino"; -import * as _411 from "./distribution/v1beta1/tx.amino"; -import * as _412 from "./feegrant/v1beta1/tx.amino"; -import * as _413 from "./gov/v1/tx.amino"; -import * as _414 from "./gov/v1beta1/tx.amino"; -import * as _415 from "./mint/v1beta1/tx.amino"; -import * as _416 from "./slashing/v1beta1/tx.amino"; -import * as _417 from "./staking/v1beta1/tx.amino"; -import * as _418 from "./upgrade/v1beta1/tx.amino"; -import * as _419 from "./auth/v1beta1/tx.registry"; -import * as _420 from "./authz/v1beta1/tx.registry"; -import * as _421 from "./bank/v1beta1/tx.registry"; -import * as _422 from "./distribution/v1beta1/tx.registry"; -import * as _423 from "./feegrant/v1beta1/tx.registry"; -import * as _424 from "./gov/v1/tx.registry"; -import * as _425 from "./gov/v1beta1/tx.registry"; -import * as _426 from "./mint/v1beta1/tx.registry"; -import * as _427 from "./slashing/v1beta1/tx.registry"; -import * as _428 from "./staking/v1beta1/tx.registry"; -import * as _429 from "./upgrade/v1beta1/tx.registry"; -import * as _430 from "./auth/v1beta1/query.rpc.Query"; -import * as _431 from "./authz/v1beta1/query.rpc.Query"; -import * as _432 from "./bank/v1beta1/query.rpc.Query"; -import * as _433 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _434 from "./distribution/v1beta1/query.rpc.Query"; -import * as _435 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _436 from "./gov/v1/query.rpc.Query"; -import * as _437 from "./gov/v1beta1/query.rpc.Query"; -import * as _438 from "./mint/v1beta1/query.rpc.Query"; -import * as _439 from "./params/v1beta1/query.rpc.Query"; -import * as _440 from "./slashing/v1beta1/query.rpc.Query"; -import * as _441 from "./staking/v1beta1/query.rpc.Query"; -import * as _442 from "./tx/v1beta1/service.rpc.Service"; -import * as _443 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _444 from "./auth/v1beta1/tx.rpc.msg"; -import * as _445 from "./authz/v1beta1/tx.rpc.msg"; -import * as _446 from "./bank/v1beta1/tx.rpc.msg"; -import * as _447 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _448 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _449 from "./gov/v1/tx.rpc.msg"; -import * as _450 from "./gov/v1beta1/tx.rpc.msg"; -import * as _451 from "./mint/v1beta1/tx.rpc.msg"; -import * as _452 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _453 from "./staking/v1beta1/tx.rpc.msg"; -import * as _454 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _674 from "./rpc.query"; -import * as _675 from "./rpc.tx"; +import * as _422 from "./auth/v1beta1/tx.amino"; +import * as _423 from "./authz/v1beta1/tx.amino"; +import * as _424 from "./bank/v1beta1/tx.amino"; +import * as _425 from "./distribution/v1beta1/tx.amino"; +import * as _426 from "./feegrant/v1beta1/tx.amino"; +import * as _427 from "./gov/v1/tx.amino"; +import * as _428 from "./gov/v1beta1/tx.amino"; +import * as _429 from "./mint/v1beta1/tx.amino"; +import * as _430 from "./slashing/v1beta1/tx.amino"; +import * as _431 from "./staking/v1beta1/tx.amino"; +import * as _432 from "./upgrade/v1beta1/tx.amino"; +import * as _433 from "./auth/v1beta1/tx.registry"; +import * as _434 from "./authz/v1beta1/tx.registry"; +import * as _435 from "./bank/v1beta1/tx.registry"; +import * as _436 from "./distribution/v1beta1/tx.registry"; +import * as _437 from "./feegrant/v1beta1/tx.registry"; +import * as _438 from "./gov/v1/tx.registry"; +import * as _439 from "./gov/v1beta1/tx.registry"; +import * as _440 from "./mint/v1beta1/tx.registry"; +import * as _441 from "./slashing/v1beta1/tx.registry"; +import * as _442 from "./staking/v1beta1/tx.registry"; +import * as _443 from "./upgrade/v1beta1/tx.registry"; +import * as _444 from "./auth/v1beta1/query.rpc.Query"; +import * as _445 from "./authz/v1beta1/query.rpc.Query"; +import * as _446 from "./bank/v1beta1/query.rpc.Query"; +import * as _447 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _448 from "./distribution/v1beta1/query.rpc.Query"; +import * as _449 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _450 from "./gov/v1/query.rpc.Query"; +import * as _451 from "./gov/v1beta1/query.rpc.Query"; +import * as _452 from "./mint/v1beta1/query.rpc.Query"; +import * as _453 from "./params/v1beta1/query.rpc.Query"; +import * as _454 from "./slashing/v1beta1/query.rpc.Query"; +import * as _455 from "./staking/v1beta1/query.rpc.Query"; +import * as _456 from "./tx/v1beta1/service.rpc.Service"; +import * as _457 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _458 from "./auth/v1beta1/tx.rpc.msg"; +import * as _459 from "./authz/v1beta1/tx.rpc.msg"; +import * as _460 from "./bank/v1beta1/tx.rpc.msg"; +import * as _461 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _462 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _463 from "./gov/v1/tx.rpc.msg"; +import * as _464 from "./gov/v1beta1/tx.rpc.msg"; +import * as _465 from "./mint/v1beta1/tx.rpc.msg"; +import * as _466 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _467 from "./staking/v1beta1/tx.rpc.msg"; +import * as _468 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _692 from "./rpc.query"; +import * as _693 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -118,10 +118,10 @@ export namespace cosmos { ..._30, ..._31, ..._32, - ..._408, - ..._419, - ..._430, - ..._444 + ..._422, + ..._433, + ..._444, + ..._458 }; } export namespace authz { @@ -131,10 +131,10 @@ export namespace cosmos { ..._35, ..._36, ..._37, - ..._409, - ..._420, - ..._431, - ..._445 + ..._423, + ..._434, + ..._445, + ..._459 }; } export namespace bank { @@ -144,10 +144,10 @@ export namespace cosmos { ..._40, ..._41, ..._42, - ..._410, - ..._421, - ..._432, - ..._446 + ..._424, + ..._435, + ..._446, + ..._460 }; } export namespace base { @@ -165,7 +165,7 @@ export namespace cosmos { export const v1beta1 = { ..._45, ..._46, - ..._433 + ..._447 }; } export const v1beta1 = { @@ -189,10 +189,10 @@ export namespace cosmos { ..._52, ..._53, ..._54, - ..._411, - ..._422, - ..._434, - ..._447 + ..._425, + ..._436, + ..._448, + ..._461 }; } export namespace evidence { @@ -206,10 +206,10 @@ export namespace cosmos { ..._57, ..._58, ..._59, - ..._412, - ..._423, - ..._435, - ..._448 + ..._426, + ..._437, + ..._449, + ..._462 }; } export namespace gov { @@ -218,20 +218,20 @@ export namespace cosmos { ..._61, ..._62, ..._63, - ..._413, - ..._424, - ..._436, - ..._449 + ..._427, + ..._438, + ..._450, + ..._463 }; export const v1beta1 = { ..._64, ..._65, ..._66, ..._67, - ..._414, - ..._425, - ..._437, - ..._450 + ..._428, + ..._439, + ..._451, + ..._464 }; } export namespace ics23 { @@ -245,10 +245,10 @@ export namespace cosmos { ..._70, ..._71, ..._72, - ..._415, - ..._426, - ..._438, - ..._451 + ..._429, + ..._440, + ..._452, + ..._465 }; } export namespace msg { @@ -265,7 +265,7 @@ export namespace cosmos { export const v1beta1 = { ..._75, ..._76, - ..._439 + ..._453 }; } export namespace query { @@ -279,10 +279,10 @@ export namespace cosmos { ..._79, ..._80, ..._81, - ..._416, - ..._427, - ..._440, - ..._452 + ..._430, + ..._441, + ..._454, + ..._466 }; } export namespace staking { @@ -292,10 +292,10 @@ export namespace cosmos { ..._84, ..._85, ..._86, - ..._417, - ..._428, - ..._441, - ..._453 + ..._431, + ..._442, + ..._455, + ..._467 }; } export namespace tx { @@ -307,7 +307,7 @@ export namespace cosmos { export const v1beta1 = { ..._88, ..._89, - ..._442 + ..._456 }; } export namespace upgrade { @@ -315,14 +315,14 @@ export namespace cosmos { ..._90, ..._91, ..._92, - ..._418, - ..._429, + ..._432, ..._443, - ..._454 + ..._457, + ..._468 }; } export const ClientFactory = { - ..._674, - ..._675 + ..._692, + ..._693 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index 4942994fa..c7a9048d2 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -10,16 +10,16 @@ import * as _101 from "./wasm/v1/proposal"; import * as _102 from "./wasm/v1/query"; import * as _103 from "./wasm/v1/tx"; import * as _104 from "./wasm/v1/types"; -import * as _455 from "./tokenfactory/v1beta1/tx.amino"; -import * as _456 from "./wasm/v1/tx.amino"; -import * as _457 from "./tokenfactory/v1beta1/tx.registry"; -import * as _458 from "./wasm/v1/tx.registry"; -import * as _459 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _460 from "./wasm/v1/query.rpc.Query"; -import * as _461 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _462 from "./wasm/v1/tx.rpc.msg"; -import * as _676 from "./rpc.query"; -import * as _677 from "./rpc.tx"; +import * as _469 from "./tokenfactory/v1beta1/tx.amino"; +import * as _470 from "./wasm/v1/tx.amino"; +import * as _471 from "./tokenfactory/v1beta1/tx.registry"; +import * as _472 from "./wasm/v1/tx.registry"; +import * as _473 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _474 from "./wasm/v1/query.rpc.Query"; +import * as _475 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _476 from "./wasm/v1/tx.rpc.msg"; +import * as _694 from "./rpc.query"; +import * as _695 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { @@ -28,10 +28,10 @@ export namespace cosmwasm { ..._95, ..._96, ..._97, - ..._455, - ..._457, - ..._459, - ..._461 + ..._469, + ..._471, + ..._473, + ..._475 }; } export namespace wasm { @@ -43,14 +43,14 @@ export namespace cosmwasm { ..._102, ..._103, ..._104, - ..._456, - ..._458, - ..._460, - ..._462 + ..._470, + ..._472, + ..._474, + ..._476 }; } export const ClientFactory = { - ..._676, - ..._677 + ..._694, + ..._695 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/bundle.ts b/packages/types/protobuf/codegen/feemarket/bundle.ts index 4feb336db..6c89dc42c 100644 --- a/packages/types/protobuf/codegen/feemarket/bundle.ts +++ b/packages/types/protobuf/codegen/feemarket/bundle.ts @@ -2,12 +2,12 @@ import * as _105 from "./feemarket/v1/genesis"; import * as _106 from "./feemarket/v1/params"; import * as _107 from "./feemarket/v1/query"; import * as _108 from "./feemarket/v1/tx"; -import * as _463 from "./feemarket/v1/tx.amino"; -import * as _464 from "./feemarket/v1/tx.registry"; -import * as _465 from "./feemarket/v1/query.rpc.Query"; -import * as _466 from "./feemarket/v1/tx.rpc.msg"; -import * as _678 from "./rpc.query"; -import * as _679 from "./rpc.tx"; +import * as _477 from "./feemarket/v1/tx.amino"; +import * as _478 from "./feemarket/v1/tx.registry"; +import * as _479 from "./feemarket/v1/query.rpc.Query"; +import * as _480 from "./feemarket/v1/tx.rpc.msg"; +import * as _696 from "./rpc.query"; +import * as _697 from "./rpc.tx"; export namespace feemarket { export namespace feemarket { export const v1 = { @@ -15,14 +15,14 @@ export namespace feemarket { ..._106, ..._107, ..._108, - ..._463, - ..._464, - ..._465, - ..._466 + ..._477, + ..._478, + ..._479, + ..._480 }; } export const ClientFactory = { - ..._678, - ..._679 + ..._696, + ..._697 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index 72bc38e2e..061f28574 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -2,29 +2,29 @@ import * as _109 from "./globalfee/v1beta1/genesis"; import * as _110 from "./globalfee/v1beta1/query"; import * as _111 from "./globalfee/v1beta1/tx"; import * as _112 from "./metaprotocols/extensions"; -import * as _467 from "./globalfee/v1beta1/tx.amino"; -import * as _468 from "./globalfee/v1beta1/tx.registry"; -import * as _469 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _470 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _680 from "./rpc.query"; -import * as _681 from "./rpc.tx"; +import * as _481 from "./globalfee/v1beta1/tx.amino"; +import * as _482 from "./globalfee/v1beta1/tx.registry"; +import * as _483 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _484 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _698 from "./rpc.query"; +import * as _699 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { ..._109, ..._110, ..._111, - ..._467, - ..._468, - ..._469, - ..._470 + ..._481, + ..._482, + ..._483, + ..._484 }; } export const metaprotocols = { ..._112 }; export const ClientFactory = { - ..._680, - ..._681 + ..._698, + ..._699 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/google/bundle.ts b/packages/types/protobuf/codegen/google/bundle.ts index ac2c0c448..0b838de74 100644 --- a/packages/types/protobuf/codegen/google/bundle.ts +++ b/packages/types/protobuf/codegen/google/bundle.ts @@ -5,6 +5,7 @@ import * as _117 from "./protobuf/descriptor"; import * as _118 from "./protobuf/duration"; import * as _119 from "./protobuf/empty"; import * as _120 from "./protobuf/timestamp"; +import * as _121 from "./protobuf/wrappers"; export namespace google { export const api = { ..._114, @@ -15,6 +16,7 @@ export namespace google { ..._117, ..._118, ..._119, - ..._120 + ..._120, + ..._121 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/google/protobuf/wrappers.ts b/packages/types/protobuf/codegen/google/protobuf/wrappers.ts new file mode 100644 index 000000000..218a68301 --- /dev/null +++ b/packages/types/protobuf/codegen/google/protobuf/wrappers.ts @@ -0,0 +1,875 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + */ +export interface DoubleValue { + /** The double value. */ + value: number; +} +export interface DoubleValueProtoMsg { + typeUrl: "/google.protobuf.DoubleValue"; + value: Uint8Array; +} +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + */ +export interface DoubleValueAmino { + /** The double value. */ + value?: number; +} +export interface DoubleValueAminoMsg { + type: "/google.protobuf.DoubleValue"; + value: DoubleValueAmino; +} +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + */ +export interface DoubleValueSDKType { + value: number; +} +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + */ +export interface FloatValue { + /** The float value. */ + value: number; +} +export interface FloatValueProtoMsg { + typeUrl: "/google.protobuf.FloatValue"; + value: Uint8Array; +} +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + */ +export interface FloatValueAmino { + /** The float value. */ + value?: number; +} +export interface FloatValueAminoMsg { + type: "/google.protobuf.FloatValue"; + value: FloatValueAmino; +} +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + */ +export interface FloatValueSDKType { + value: number; +} +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + */ +export interface Int64Value { + /** The int64 value. */ + value: bigint; +} +export interface Int64ValueProtoMsg { + typeUrl: "/google.protobuf.Int64Value"; + value: Uint8Array; +} +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + */ +export interface Int64ValueAmino { + /** The int64 value. */ + value?: string; +} +export interface Int64ValueAminoMsg { + type: "/google.protobuf.Int64Value"; + value: Int64ValueAmino; +} +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + */ +export interface Int64ValueSDKType { + value: bigint; +} +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + */ +export interface UInt64Value { + /** The uint64 value. */ + value: bigint; +} +export interface UInt64ValueProtoMsg { + typeUrl: "/google.protobuf.UInt64Value"; + value: Uint8Array; +} +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + */ +export interface UInt64ValueAmino { + /** The uint64 value. */ + value?: string; +} +export interface UInt64ValueAminoMsg { + type: "/google.protobuf.UInt64Value"; + value: UInt64ValueAmino; +} +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + */ +export interface UInt64ValueSDKType { + value: bigint; +} +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + */ +export interface Int32Value { + /** The int32 value. */ + value: number; +} +export interface Int32ValueProtoMsg { + typeUrl: "/google.protobuf.Int32Value"; + value: Uint8Array; +} +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + */ +export interface Int32ValueAmino { + /** The int32 value. */ + value?: number; +} +export interface Int32ValueAminoMsg { + type: "/google.protobuf.Int32Value"; + value: Int32ValueAmino; +} +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + */ +export interface Int32ValueSDKType { + value: number; +} +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + */ +export interface UInt32Value { + /** The uint32 value. */ + value: number; +} +export interface UInt32ValueProtoMsg { + typeUrl: "/google.protobuf.UInt32Value"; + value: Uint8Array; +} +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + */ +export interface UInt32ValueAmino { + /** The uint32 value. */ + value?: number; +} +export interface UInt32ValueAminoMsg { + type: "/google.protobuf.UInt32Value"; + value: UInt32ValueAmino; +} +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + */ +export interface UInt32ValueSDKType { + value: number; +} +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + */ +export interface BoolValue { + /** The bool value. */ + value: boolean; +} +export interface BoolValueProtoMsg { + typeUrl: "/google.protobuf.BoolValue"; + value: Uint8Array; +} +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + */ +export interface BoolValueAmino { + /** The bool value. */ + value?: boolean; +} +export interface BoolValueAminoMsg { + type: "/google.protobuf.BoolValue"; + value: BoolValueAmino; +} +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + */ +export interface BoolValueSDKType { + value: boolean; +} +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + */ +export interface StringValue { + /** The string value. */ + value: string; +} +export interface StringValueProtoMsg { + typeUrl: "/google.protobuf.StringValue"; + value: Uint8Array; +} +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + */ +export interface StringValueAmino { + /** The string value. */ + value?: string; +} +export interface StringValueAminoMsg { + type: "/google.protobuf.StringValue"; + value: StringValueAmino; +} +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + */ +export interface StringValueSDKType { + value: string; +} +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + */ +export interface BytesValue { + /** The bytes value. */ + value: Uint8Array; +} +export interface BytesValueProtoMsg { + typeUrl: "/google.protobuf.BytesValue"; + value: Uint8Array; +} +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + */ +export interface BytesValueAmino { + /** The bytes value. */ + value?: string; +} +export interface BytesValueAminoMsg { + type: "/google.protobuf.BytesValue"; + value: BytesValueAmino; +} +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + */ +export interface BytesValueSDKType { + value: Uint8Array; +} +function createBaseDoubleValue(): DoubleValue { + return { + value: 0 + }; +} +export const DoubleValue = { + typeUrl: "/google.protobuf.DoubleValue", + encode(message: DoubleValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(9).double(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): DoubleValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDoubleValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DoubleValue { + const message = createBaseDoubleValue(); + message.value = object.value ?? 0; + return message; + }, + fromAmino(object: DoubleValueAmino): DoubleValue { + const message = createBaseDoubleValue(); + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: DoubleValue, useInterfaces: boolean = false): DoubleValueAmino { + const obj: any = {}; + obj.value = message.value === 0 ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: DoubleValueAminoMsg): DoubleValue { + return DoubleValue.fromAmino(object.value); + }, + fromProtoMsg(message: DoubleValueProtoMsg, useInterfaces: boolean = false): DoubleValue { + return DoubleValue.decode(message.value, undefined, useInterfaces); + }, + toProto(message: DoubleValue): Uint8Array { + return DoubleValue.encode(message).finish(); + }, + toProtoMsg(message: DoubleValue): DoubleValueProtoMsg { + return { + typeUrl: "/google.protobuf.DoubleValue", + value: DoubleValue.encode(message).finish() + }; + } +}; +function createBaseFloatValue(): FloatValue { + return { + value: 0 + }; +} +export const FloatValue = { + typeUrl: "/google.protobuf.FloatValue", + encode(message: FloatValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(13).float(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): FloatValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFloatValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FloatValue { + const message = createBaseFloatValue(); + message.value = object.value ?? 0; + return message; + }, + fromAmino(object: FloatValueAmino): FloatValue { + const message = createBaseFloatValue(); + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: FloatValue, useInterfaces: boolean = false): FloatValueAmino { + const obj: any = {}; + obj.value = message.value === 0 ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: FloatValueAminoMsg): FloatValue { + return FloatValue.fromAmino(object.value); + }, + fromProtoMsg(message: FloatValueProtoMsg, useInterfaces: boolean = false): FloatValue { + return FloatValue.decode(message.value, undefined, useInterfaces); + }, + toProto(message: FloatValue): Uint8Array { + return FloatValue.encode(message).finish(); + }, + toProtoMsg(message: FloatValue): FloatValueProtoMsg { + return { + typeUrl: "/google.protobuf.FloatValue", + value: FloatValue.encode(message).finish() + }; + } +}; +function createBaseInt64Value(): Int64Value { + return { + value: BigInt(0) + }; +} +export const Int64Value = { + typeUrl: "/google.protobuf.Int64Value", + encode(message: Int64Value, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== BigInt(0)) { + writer.uint32(8).int64(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Int64Value { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInt64Value(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Int64Value { + const message = createBaseInt64Value(); + message.value = object.value !== undefined && object.value !== null ? BigInt(object.value.toString()) : BigInt(0); + return message; + }, + fromAmino(object: Int64ValueAmino): Int64Value { + const message = createBaseInt64Value(); + if (object.value !== undefined && object.value !== null) { + message.value = BigInt(object.value); + } + return message; + }, + toAmino(message: Int64Value, useInterfaces: boolean = false): Int64ValueAmino { + const obj: any = {}; + obj.value = message.value !== BigInt(0) ? message.value.toString() : undefined; + return obj; + }, + fromAminoMsg(object: Int64ValueAminoMsg): Int64Value { + return Int64Value.fromAmino(object.value); + }, + fromProtoMsg(message: Int64ValueProtoMsg, useInterfaces: boolean = false): Int64Value { + return Int64Value.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Int64Value): Uint8Array { + return Int64Value.encode(message).finish(); + }, + toProtoMsg(message: Int64Value): Int64ValueProtoMsg { + return { + typeUrl: "/google.protobuf.Int64Value", + value: Int64Value.encode(message).finish() + }; + } +}; +function createBaseUInt64Value(): UInt64Value { + return { + value: BigInt(0) + }; +} +export const UInt64Value = { + typeUrl: "/google.protobuf.UInt64Value", + encode(message: UInt64Value, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== BigInt(0)) { + writer.uint32(8).uint64(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UInt64Value { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUInt64Value(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UInt64Value { + const message = createBaseUInt64Value(); + message.value = object.value !== undefined && object.value !== null ? BigInt(object.value.toString()) : BigInt(0); + return message; + }, + fromAmino(object: UInt64ValueAmino): UInt64Value { + const message = createBaseUInt64Value(); + if (object.value !== undefined && object.value !== null) { + message.value = BigInt(object.value); + } + return message; + }, + toAmino(message: UInt64Value, useInterfaces: boolean = false): UInt64ValueAmino { + const obj: any = {}; + obj.value = message.value !== BigInt(0) ? message.value.toString() : undefined; + return obj; + }, + fromAminoMsg(object: UInt64ValueAminoMsg): UInt64Value { + return UInt64Value.fromAmino(object.value); + }, + fromProtoMsg(message: UInt64ValueProtoMsg, useInterfaces: boolean = false): UInt64Value { + return UInt64Value.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UInt64Value): Uint8Array { + return UInt64Value.encode(message).finish(); + }, + toProtoMsg(message: UInt64Value): UInt64ValueProtoMsg { + return { + typeUrl: "/google.protobuf.UInt64Value", + value: UInt64Value.encode(message).finish() + }; + } +}; +function createBaseInt32Value(): Int32Value { + return { + value: 0 + }; +} +export const Int32Value = { + typeUrl: "/google.protobuf.Int32Value", + encode(message: Int32Value, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(8).int32(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Int32Value { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInt32Value(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Int32Value { + const message = createBaseInt32Value(); + message.value = object.value ?? 0; + return message; + }, + fromAmino(object: Int32ValueAmino): Int32Value { + const message = createBaseInt32Value(); + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: Int32Value, useInterfaces: boolean = false): Int32ValueAmino { + const obj: any = {}; + obj.value = message.value === 0 ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: Int32ValueAminoMsg): Int32Value { + return Int32Value.fromAmino(object.value); + }, + fromProtoMsg(message: Int32ValueProtoMsg, useInterfaces: boolean = false): Int32Value { + return Int32Value.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Int32Value): Uint8Array { + return Int32Value.encode(message).finish(); + }, + toProtoMsg(message: Int32Value): Int32ValueProtoMsg { + return { + typeUrl: "/google.protobuf.Int32Value", + value: Int32Value.encode(message).finish() + }; + } +}; +function createBaseUInt32Value(): UInt32Value { + return { + value: 0 + }; +} +export const UInt32Value = { + typeUrl: "/google.protobuf.UInt32Value", + encode(message: UInt32Value, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(8).uint32(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UInt32Value { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUInt32Value(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UInt32Value { + const message = createBaseUInt32Value(); + message.value = object.value ?? 0; + return message; + }, + fromAmino(object: UInt32ValueAmino): UInt32Value { + const message = createBaseUInt32Value(); + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: UInt32Value, useInterfaces: boolean = false): UInt32ValueAmino { + const obj: any = {}; + obj.value = message.value === 0 ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: UInt32ValueAminoMsg): UInt32Value { + return UInt32Value.fromAmino(object.value); + }, + fromProtoMsg(message: UInt32ValueProtoMsg, useInterfaces: boolean = false): UInt32Value { + return UInt32Value.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UInt32Value): Uint8Array { + return UInt32Value.encode(message).finish(); + }, + toProtoMsg(message: UInt32Value): UInt32ValueProtoMsg { + return { + typeUrl: "/google.protobuf.UInt32Value", + value: UInt32Value.encode(message).finish() + }; + } +}; +function createBaseBoolValue(): BoolValue { + return { + value: false + }; +} +export const BoolValue = { + typeUrl: "/google.protobuf.BoolValue", + encode(message: BoolValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value === true) { + writer.uint32(8).bool(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): BoolValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBoolValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BoolValue { + const message = createBaseBoolValue(); + message.value = object.value ?? false; + return message; + }, + fromAmino(object: BoolValueAmino): BoolValue { + const message = createBaseBoolValue(); + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: BoolValue, useInterfaces: boolean = false): BoolValueAmino { + const obj: any = {}; + obj.value = message.value === false ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: BoolValueAminoMsg): BoolValue { + return BoolValue.fromAmino(object.value); + }, + fromProtoMsg(message: BoolValueProtoMsg, useInterfaces: boolean = false): BoolValue { + return BoolValue.decode(message.value, undefined, useInterfaces); + }, + toProto(message: BoolValue): Uint8Array { + return BoolValue.encode(message).finish(); + }, + toProtoMsg(message: BoolValue): BoolValueProtoMsg { + return { + typeUrl: "/google.protobuf.BoolValue", + value: BoolValue.encode(message).finish() + }; + } +}; +function createBaseStringValue(): StringValue { + return { + value: "" + }; +} +export const StringValue = { + typeUrl: "/google.protobuf.StringValue", + encode(message: StringValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== "") { + writer.uint32(10).string(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): StringValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStringValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StringValue { + const message = createBaseStringValue(); + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: StringValueAmino): StringValue { + const message = createBaseStringValue(); + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: StringValue, useInterfaces: boolean = false): StringValueAmino { + const obj: any = {}; + obj.value = message.value === "" ? undefined : message.value; + return obj; + }, + fromAminoMsg(object: StringValueAminoMsg): StringValue { + return StringValue.fromAmino(object.value); + }, + fromProtoMsg(message: StringValueProtoMsg, useInterfaces: boolean = false): StringValue { + return StringValue.decode(message.value, undefined, useInterfaces); + }, + toProto(message: StringValue): Uint8Array { + return StringValue.encode(message).finish(); + }, + toProtoMsg(message: StringValue): StringValueProtoMsg { + return { + typeUrl: "/google.protobuf.StringValue", + value: StringValue.encode(message).finish() + }; + } +}; +function createBaseBytesValue(): BytesValue { + return { + value: new Uint8Array() + }; +} +export const BytesValue = { + typeUrl: "/google.protobuf.BytesValue", + encode(message: BytesValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value.length !== 0) { + writer.uint32(10).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): BytesValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBytesValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BytesValue { + const message = createBaseBytesValue(); + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: BytesValueAmino): BytesValue { + const message = createBaseBytesValue(); + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: BytesValue, useInterfaces: boolean = false): BytesValueAmino { + const obj: any = {}; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: BytesValueAminoMsg): BytesValue { + return BytesValue.fromAmino(object.value); + }, + fromProtoMsg(message: BytesValueProtoMsg, useInterfaces: boolean = false): BytesValue { + return BytesValue.decode(message.value, undefined, useInterfaces); + }, + toProto(message: BytesValue): Uint8Array { + return BytesValue.encode(message).finish(); + }, + toProtoMsg(message: BytesValue): BytesValueProtoMsg { + return { + typeUrl: "/google.protobuf.BytesValue", + value: BytesValue.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index c9c2ed9b9..ab17a5af3 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -1,154 +1,154 @@ -import * as _121 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _122 from "./applications/interchain_accounts/controller/v1/query"; -import * as _123 from "./applications/interchain_accounts/controller/v1/tx"; -import * as _124 from "./applications/interchain_accounts/host/v1/host"; -import * as _125 from "./applications/interchain_accounts/host/v1/query"; -import * as _126 from "./applications/interchain_accounts/host/v1/tx"; -import * as _127 from "./applications/interchain_accounts/v1/account"; -import * as _128 from "./applications/interchain_accounts/v1/metadata"; -import * as _129 from "./applications/interchain_accounts/v1/packet"; -import * as _130 from "./applications/transfer/v1/authz"; -import * as _131 from "./applications/transfer/v1/genesis"; -import * as _132 from "./applications/transfer/v1/query"; -import * as _133 from "./applications/transfer/v1/transfer"; -import * as _134 from "./applications/transfer/v1/tx"; -import * as _135 from "./core/channel/v1/channel"; -import * as _136 from "./core/channel/v1/genesis"; -import * as _137 from "./core/channel/v1/query"; -import * as _138 from "./core/channel/v1/tx"; -import * as _139 from "./core/client/v1/client"; -import * as _140 from "./core/client/v1/genesis"; -import * as _141 from "./core/client/v1/query"; -import * as _142 from "./core/client/v1/tx"; -import * as _143 from "./core/commitment/v1/commitment"; -import * as _144 from "./core/connection/v1/connection"; -import * as _145 from "./core/connection/v1/genesis"; -import * as _146 from "./core/connection/v1/query"; -import * as _147 from "./core/connection/v1/tx"; -import * as _148 from "./lightclients/tendermint/v1/tendermint"; -import * as _471 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _472 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _473 from "./applications/transfer/v1/tx.amino"; -import * as _474 from "./core/channel/v1/tx.amino"; -import * as _475 from "./core/client/v1/tx.amino"; -import * as _476 from "./core/connection/v1/tx.amino"; -import * as _477 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _478 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _479 from "./applications/transfer/v1/tx.registry"; -import * as _480 from "./core/channel/v1/tx.registry"; -import * as _481 from "./core/client/v1/tx.registry"; -import * as _482 from "./core/connection/v1/tx.registry"; -import * as _483 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _484 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _485 from "./applications/transfer/v1/query.rpc.Query"; -import * as _486 from "./core/channel/v1/query.rpc.Query"; -import * as _487 from "./core/client/v1/query.rpc.Query"; -import * as _488 from "./core/connection/v1/query.rpc.Query"; -import * as _489 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _490 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _491 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _492 from "./core/channel/v1/tx.rpc.msg"; -import * as _493 from "./core/client/v1/tx.rpc.msg"; -import * as _494 from "./core/connection/v1/tx.rpc.msg"; -import * as _682 from "./rpc.query"; -import * as _683 from "./rpc.tx"; +import * as _122 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _123 from "./applications/interchain_accounts/controller/v1/query"; +import * as _124 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _125 from "./applications/interchain_accounts/host/v1/host"; +import * as _126 from "./applications/interchain_accounts/host/v1/query"; +import * as _127 from "./applications/interchain_accounts/host/v1/tx"; +import * as _128 from "./applications/interchain_accounts/v1/account"; +import * as _129 from "./applications/interchain_accounts/v1/metadata"; +import * as _130 from "./applications/interchain_accounts/v1/packet"; +import * as _131 from "./applications/transfer/v1/authz"; +import * as _132 from "./applications/transfer/v1/genesis"; +import * as _133 from "./applications/transfer/v1/query"; +import * as _134 from "./applications/transfer/v1/transfer"; +import * as _135 from "./applications/transfer/v1/tx"; +import * as _136 from "./core/channel/v1/channel"; +import * as _137 from "./core/channel/v1/genesis"; +import * as _138 from "./core/channel/v1/query"; +import * as _139 from "./core/channel/v1/tx"; +import * as _140 from "./core/client/v1/client"; +import * as _141 from "./core/client/v1/genesis"; +import * as _142 from "./core/client/v1/query"; +import * as _143 from "./core/client/v1/tx"; +import * as _144 from "./core/commitment/v1/commitment"; +import * as _145 from "./core/connection/v1/connection"; +import * as _146 from "./core/connection/v1/genesis"; +import * as _147 from "./core/connection/v1/query"; +import * as _148 from "./core/connection/v1/tx"; +import * as _149 from "./lightclients/tendermint/v1/tendermint"; +import * as _485 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _486 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _487 from "./applications/transfer/v1/tx.amino"; +import * as _488 from "./core/channel/v1/tx.amino"; +import * as _489 from "./core/client/v1/tx.amino"; +import * as _490 from "./core/connection/v1/tx.amino"; +import * as _491 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _492 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _493 from "./applications/transfer/v1/tx.registry"; +import * as _494 from "./core/channel/v1/tx.registry"; +import * as _495 from "./core/client/v1/tx.registry"; +import * as _496 from "./core/connection/v1/tx.registry"; +import * as _497 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _498 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _499 from "./applications/transfer/v1/query.rpc.Query"; +import * as _500 from "./core/channel/v1/query.rpc.Query"; +import * as _501 from "./core/client/v1/query.rpc.Query"; +import * as _502 from "./core/connection/v1/query.rpc.Query"; +import * as _503 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _504 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _505 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _506 from "./core/channel/v1/tx.rpc.msg"; +import * as _507 from "./core/client/v1/tx.rpc.msg"; +import * as _508 from "./core/connection/v1/tx.rpc.msg"; +import * as _700 from "./rpc.query"; +import * as _701 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._121, ..._122, ..._123, - ..._471, - ..._477, - ..._483, - ..._489 + ..._124, + ..._485, + ..._491, + ..._497, + ..._503 }; } export namespace host { export const v1 = { - ..._124, ..._125, ..._126, - ..._472, - ..._478, - ..._484, - ..._490 + ..._127, + ..._486, + ..._492, + ..._498, + ..._504 }; } export const v1 = { - ..._127, ..._128, - ..._129 + ..._129, + ..._130 }; } export namespace transfer { export const v1 = { - ..._130, ..._131, ..._132, ..._133, ..._134, - ..._473, - ..._479, - ..._485, - ..._491 + ..._135, + ..._487, + ..._493, + ..._499, + ..._505 }; } } export namespace core { export namespace channel { export const v1 = { - ..._135, ..._136, ..._137, ..._138, - ..._474, - ..._480, - ..._486, - ..._492 + ..._139, + ..._488, + ..._494, + ..._500, + ..._506 }; } export namespace client { export const v1 = { - ..._139, ..._140, ..._141, ..._142, - ..._475, - ..._481, - ..._487, - ..._493 + ..._143, + ..._489, + ..._495, + ..._501, + ..._507 }; } export namespace commitment { export const v1 = { - ..._143 + ..._144 }; } export namespace connection { export const v1 = { - ..._144, ..._145, ..._146, ..._147, - ..._476, - ..._482, - ..._488, - ..._494 + ..._148, + ..._490, + ..._496, + ..._502, + ..._508 }; } } export namespace lightclients { export namespace tendermint { export const v1 = { - ..._148 + ..._149 }; } } export const ClientFactory = { - ..._682, - ..._683 + ..._700, + ..._701 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/index.ts b/packages/types/protobuf/codegen/index.ts index 6f6ff0db6..2aa341649 100644 --- a/packages/types/protobuf/codegen/index.ts +++ b/packages/types/protobuf/codegen/index.ts @@ -44,6 +44,8 @@ export * from "./regen/bundle"; export * from "./regen/client"; export * from "./secret/bundle"; export * from "./secret/client"; +export * from "./Switcheo/bundle"; +export * from "./Switcheo/client"; export * from "./noble/bundle"; export * from "./tendermint/bundle"; export * from "./varint"; diff --git a/packages/types/protobuf/codegen/interchain_security/bundle.ts b/packages/types/protobuf/codegen/interchain_security/bundle.ts index 16beb8495..ab71a6783 100644 --- a/packages/types/protobuf/codegen/interchain_security/bundle.ts +++ b/packages/types/protobuf/codegen/interchain_security/bundle.ts @@ -1,56 +1,56 @@ -import * as _149 from "./ccv/consumer/v1/consumer"; -import * as _150 from "./ccv/consumer/v1/genesis"; -import * as _151 from "./ccv/consumer/v1/query"; -import * as _152 from "./ccv/consumer/v1/tx"; -import * as _153 from "./ccv/provider/v1/genesis"; -import * as _154 from "./ccv/provider/v1/provider"; -import * as _155 from "./ccv/provider/v1/query"; -import * as _156 from "./ccv/provider/v1/tx"; -import * as _157 from "./ccv/v1/shared_consumer"; -import * as _158 from "./ccv/v1/wire"; -import * as _495 from "./ccv/consumer/v1/tx.amino"; -import * as _496 from "./ccv/provider/v1/tx.amino"; -import * as _497 from "./ccv/consumer/v1/tx.registry"; -import * as _498 from "./ccv/provider/v1/tx.registry"; -import * as _499 from "./ccv/consumer/v1/query.rpc.Query"; -import * as _500 from "./ccv/provider/v1/query.rpc.Query"; -import * as _501 from "./ccv/consumer/v1/tx.rpc.msg"; -import * as _502 from "./ccv/provider/v1/tx.rpc.msg"; -import * as _684 from "./rpc.query"; -import * as _685 from "./rpc.tx"; +import * as _150 from "./ccv/consumer/v1/consumer"; +import * as _151 from "./ccv/consumer/v1/genesis"; +import * as _152 from "./ccv/consumer/v1/query"; +import * as _153 from "./ccv/consumer/v1/tx"; +import * as _154 from "./ccv/provider/v1/genesis"; +import * as _155 from "./ccv/provider/v1/provider"; +import * as _156 from "./ccv/provider/v1/query"; +import * as _157 from "./ccv/provider/v1/tx"; +import * as _158 from "./ccv/v1/shared_consumer"; +import * as _159 from "./ccv/v1/wire"; +import * as _509 from "./ccv/consumer/v1/tx.amino"; +import * as _510 from "./ccv/provider/v1/tx.amino"; +import * as _511 from "./ccv/consumer/v1/tx.registry"; +import * as _512 from "./ccv/provider/v1/tx.registry"; +import * as _513 from "./ccv/consumer/v1/query.rpc.Query"; +import * as _514 from "./ccv/provider/v1/query.rpc.Query"; +import * as _515 from "./ccv/consumer/v1/tx.rpc.msg"; +import * as _516 from "./ccv/provider/v1/tx.rpc.msg"; +import * as _702 from "./rpc.query"; +import * as _703 from "./rpc.tx"; export namespace interchain_security { export namespace ccv { export namespace consumer { export const v1 = { - ..._149, ..._150, ..._151, ..._152, - ..._495, - ..._497, - ..._499, - ..._501 + ..._153, + ..._509, + ..._511, + ..._513, + ..._515 }; } export namespace provider { export const v1 = { - ..._153, ..._154, ..._155, ..._156, - ..._496, - ..._498, - ..._500, - ..._502 + ..._157, + ..._510, + ..._512, + ..._514, + ..._516 }; } export const v1 = { - ..._157, - ..._158 + ..._158, + ..._159 }; } export const ClientFactory = { - ..._684, - ..._685 + ..._702, + ..._703 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index fcd614f0c..a8030eb24 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -1,46 +1,46 @@ -import * as _159 from "./feeshare/v1/feeshare"; -import * as _160 from "./feeshare/v1/genesis"; -import * as _161 from "./feeshare/v1/query"; -import * as _162 from "./feeshare/v1/tx"; -import * as _163 from "./mint/genesis"; -import * as _164 from "./mint/mint"; -import * as _165 from "./mint/query"; -import * as _166 from "./mint/tx"; -import * as _503 from "./feeshare/v1/tx.amino"; -import * as _504 from "./mint/tx.amino"; -import * as _505 from "./feeshare/v1/tx.registry"; -import * as _506 from "./mint/tx.registry"; -import * as _507 from "./feeshare/v1/query.rpc.Query"; -import * as _508 from "./mint/query.rpc.Query"; -import * as _509 from "./feeshare/v1/tx.rpc.msg"; -import * as _510 from "./mint/tx.rpc.msg"; -import * as _686 from "./rpc.query"; -import * as _687 from "./rpc.tx"; +import * as _160 from "./feeshare/v1/feeshare"; +import * as _161 from "./feeshare/v1/genesis"; +import * as _162 from "./feeshare/v1/query"; +import * as _163 from "./feeshare/v1/tx"; +import * as _164 from "./mint/genesis"; +import * as _165 from "./mint/mint"; +import * as _166 from "./mint/query"; +import * as _167 from "./mint/tx"; +import * as _517 from "./feeshare/v1/tx.amino"; +import * as _518 from "./mint/tx.amino"; +import * as _519 from "./feeshare/v1/tx.registry"; +import * as _520 from "./mint/tx.registry"; +import * as _521 from "./feeshare/v1/query.rpc.Query"; +import * as _522 from "./mint/query.rpc.Query"; +import * as _523 from "./feeshare/v1/tx.rpc.msg"; +import * as _524 from "./mint/tx.rpc.msg"; +import * as _704 from "./rpc.query"; +import * as _705 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { - ..._159, ..._160, ..._161, ..._162, - ..._503, - ..._505, - ..._507, - ..._509 + ..._163, + ..._517, + ..._519, + ..._521, + ..._523 }; } export const mint = { - ..._163, ..._164, ..._165, ..._166, - ..._504, - ..._506, - ..._508, - ..._510 + ..._167, + ..._518, + ..._520, + ..._522, + ..._524 }; export const ClientFactory = { - ..._686, - ..._687 + ..._704, + ..._705 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index 00ae809c0..15963dc51 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -1,60 +1,60 @@ -import * as _167 from "./denom/authorityMetadata"; -import * as _168 from "./denom/genesis"; -import * as _169 from "./denom/params"; -import * as _170 from "./denom/query"; -import * as _171 from "./denom/tx"; -import * as _172 from "./oracle/genesis"; -import * as _173 from "./oracle/oracle"; -import * as _174 from "./oracle/query"; -import * as _175 from "./oracle/tx"; -import * as _176 from "./scheduler/genesis"; -import * as _177 from "./scheduler/hook"; -import * as _178 from "./scheduler/params"; -import * as _179 from "./scheduler/proposal"; -import * as _180 from "./scheduler/query"; -import * as _511 from "./denom/tx.amino"; -import * as _512 from "./oracle/tx.amino"; -import * as _513 from "./denom/tx.registry"; -import * as _514 from "./oracle/tx.registry"; -import * as _515 from "./denom/query.rpc.Query"; -import * as _516 from "./oracle/query.rpc.Query"; -import * as _517 from "./scheduler/query.rpc.Query"; -import * as _518 from "./denom/tx.rpc.msg"; -import * as _519 from "./oracle/tx.rpc.msg"; -import * as _688 from "./rpc.query"; -import * as _689 from "./rpc.tx"; +import * as _168 from "./denom/authorityMetadata"; +import * as _169 from "./denom/genesis"; +import * as _170 from "./denom/params"; +import * as _171 from "./denom/query"; +import * as _172 from "./denom/tx"; +import * as _173 from "./oracle/genesis"; +import * as _174 from "./oracle/oracle"; +import * as _175 from "./oracle/query"; +import * as _176 from "./oracle/tx"; +import * as _177 from "./scheduler/genesis"; +import * as _178 from "./scheduler/hook"; +import * as _179 from "./scheduler/params"; +import * as _180 from "./scheduler/proposal"; +import * as _181 from "./scheduler/query"; +import * as _525 from "./denom/tx.amino"; +import * as _526 from "./oracle/tx.amino"; +import * as _527 from "./denom/tx.registry"; +import * as _528 from "./oracle/tx.registry"; +import * as _529 from "./denom/query.rpc.Query"; +import * as _530 from "./oracle/query.rpc.Query"; +import * as _531 from "./scheduler/query.rpc.Query"; +import * as _532 from "./denom/tx.rpc.msg"; +import * as _533 from "./oracle/tx.rpc.msg"; +import * as _706 from "./rpc.query"; +import * as _707 from "./rpc.tx"; export namespace kujira { export const denom = { - ..._167, ..._168, ..._169, ..._170, ..._171, - ..._511, - ..._513, - ..._515, - ..._518 + ..._172, + ..._525, + ..._527, + ..._529, + ..._532 }; export const oracle = { - ..._172, ..._173, ..._174, ..._175, - ..._512, - ..._514, - ..._516, - ..._519 + ..._176, + ..._526, + ..._528, + ..._530, + ..._533 }; export const scheduler = { - ..._176, ..._177, ..._178, ..._179, ..._180, - ..._517 + ..._181, + ..._531 }; export const ClientFactory = { - ..._688, - ..._689 + ..._706, + ..._707 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index a4b995a80..6f34b7a92 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -1,86 +1,85 @@ -import * as _181 from "./contractmanager/v1/failure"; -import * as _182 from "./cron/genesis"; -import * as _183 from "./cron/params"; -import * as _184 from "./cron/query"; -import * as _185 from "./cron/schedule"; -import * as _186 from "./cron/tx"; -import * as _187 from "./dex/deposit_record"; -import * as _188 from "./dex/genesis"; -import * as _189 from "./dex/limit_order_expiration"; -import * as _190 from "./dex/limit_order_tranche_user"; -import * as _191 from "./dex/limit_order_tranche"; -import * as _192 from "./dex/pair_id"; -import * as _193 from "./dex/params"; -import * as _194 from "./dex/pool_metadata"; -import * as _195 from "./dex/pool_reserves"; -import * as _196 from "./dex/pool"; -import * as _197 from "./dex/query"; -import * as _198 from "./dex/tick_liquidity"; -import * as _199 from "./dex/trade_pair_id"; -import * as _200 from "./dex/tx"; -import * as _201 from "./feeburner/genesis"; -import * as _202 from "./feeburner/params"; -import * as _203 from "./feeburner/query"; -import * as _204 from "./feeburner/total_burned_neutrons_amount"; -import * as _205 from "./feeburner/tx"; -import * as _206 from "./feerefunder/fee"; -import * as _207 from "./feerefunder/genesis"; -import * as _208 from "./feerefunder/params"; -import * as _209 from "./feerefunder/query"; -import * as _210 from "./feerefunder/tx"; -import * as _211 from "./interchainqueries/genesis"; -import * as _212 from "./interchainqueries/params"; -import * as _213 from "./interchainqueries/query"; -import * as _214 from "./interchainqueries/tx"; -import * as _215 from "./interchaintxs/v1/genesis"; -import * as _216 from "./interchaintxs/v1/params"; -import * as _217 from "./interchaintxs/v1/query"; -import * as _218 from "./interchaintxs/v1/tx"; -import * as _520 from "./cron/tx.amino"; -import * as _521 from "./dex/tx.amino"; -import * as _522 from "./feeburner/tx.amino"; -import * as _523 from "./feerefunder/tx.amino"; -import * as _524 from "./interchainqueries/tx.amino"; -import * as _525 from "./interchaintxs/v1/tx.amino"; -import * as _526 from "./cron/tx.registry"; -import * as _527 from "./dex/tx.registry"; -import * as _528 from "./feeburner/tx.registry"; -import * as _529 from "./feerefunder/tx.registry"; -import * as _530 from "./interchainqueries/tx.registry"; -import * as _531 from "./interchaintxs/v1/tx.registry"; -import * as _532 from "./cron/query.rpc.Query"; -import * as _533 from "./dex/query.rpc.Query"; -import * as _534 from "./feeburner/query.rpc.Query"; -import * as _535 from "./feerefunder/query.rpc.Query"; -import * as _536 from "./interchainqueries/query.rpc.Query"; -import * as _537 from "./interchaintxs/v1/query.rpc.Query"; -import * as _538 from "./cron/tx.rpc.msg"; -import * as _539 from "./dex/tx.rpc.msg"; -import * as _540 from "./feeburner/tx.rpc.msg"; -import * as _541 from "./feerefunder/tx.rpc.msg"; -import * as _542 from "./interchainqueries/tx.rpc.msg"; -import * as _543 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _690 from "./rpc.query"; -import * as _691 from "./rpc.tx"; +import * as _182 from "./contractmanager/v1/failure"; +import * as _183 from "./cron/genesis"; +import * as _184 from "./cron/params"; +import * as _185 from "./cron/query"; +import * as _186 from "./cron/schedule"; +import * as _187 from "./cron/tx"; +import * as _188 from "./dex/deposit_record"; +import * as _189 from "./dex/genesis"; +import * as _190 from "./dex/limit_order_expiration"; +import * as _191 from "./dex/limit_order_tranche_user"; +import * as _192 from "./dex/limit_order_tranche"; +import * as _193 from "./dex/pair_id"; +import * as _194 from "./dex/params"; +import * as _195 from "./dex/pool_metadata"; +import * as _196 from "./dex/pool_reserves"; +import * as _197 from "./dex/pool"; +import * as _198 from "./dex/query"; +import * as _199 from "./dex/tick_liquidity"; +import * as _200 from "./dex/trade_pair_id"; +import * as _201 from "./dex/tx"; +import * as _202 from "./feeburner/genesis"; +import * as _203 from "./feeburner/params"; +import * as _204 from "./feeburner/query"; +import * as _205 from "./feeburner/total_burned_neutrons_amount"; +import * as _206 from "./feeburner/tx"; +import * as _207 from "./feerefunder/fee"; +import * as _208 from "./feerefunder/genesis"; +import * as _209 from "./feerefunder/params"; +import * as _210 from "./feerefunder/query"; +import * as _211 from "./feerefunder/tx"; +import * as _212 from "./interchainqueries/genesis"; +import * as _213 from "./interchainqueries/params"; +import * as _214 from "./interchainqueries/query"; +import * as _215 from "./interchainqueries/tx"; +import * as _216 from "./interchaintxs/v1/genesis"; +import * as _217 from "./interchaintxs/v1/params"; +import * as _218 from "./interchaintxs/v1/query"; +import * as _219 from "./interchaintxs/v1/tx"; +import * as _534 from "./cron/tx.amino"; +import * as _535 from "./dex/tx.amino"; +import * as _536 from "./feeburner/tx.amino"; +import * as _537 from "./feerefunder/tx.amino"; +import * as _538 from "./interchainqueries/tx.amino"; +import * as _539 from "./interchaintxs/v1/tx.amino"; +import * as _540 from "./cron/tx.registry"; +import * as _541 from "./dex/tx.registry"; +import * as _542 from "./feeburner/tx.registry"; +import * as _543 from "./feerefunder/tx.registry"; +import * as _544 from "./interchainqueries/tx.registry"; +import * as _545 from "./interchaintxs/v1/tx.registry"; +import * as _546 from "./cron/query.rpc.Query"; +import * as _547 from "./dex/query.rpc.Query"; +import * as _548 from "./feeburner/query.rpc.Query"; +import * as _549 from "./feerefunder/query.rpc.Query"; +import * as _550 from "./interchainqueries/query.rpc.Query"; +import * as _551 from "./interchaintxs/v1/query.rpc.Query"; +import * as _552 from "./cron/tx.rpc.msg"; +import * as _553 from "./dex/tx.rpc.msg"; +import * as _554 from "./feeburner/tx.rpc.msg"; +import * as _555 from "./feerefunder/tx.rpc.msg"; +import * as _556 from "./interchainqueries/tx.rpc.msg"; +import * as _557 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _708 from "./rpc.query"; +import * as _709 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { - ..._181 + ..._182 }; } export const cron = { - ..._182, ..._183, ..._184, ..._185, ..._186, - ..._520, - ..._526, - ..._532, - ..._538 + ..._187, + ..._534, + ..._540, + ..._546, + ..._552 }; export const dex = { - ..._187, ..._188, ..._189, ..._190, @@ -94,57 +93,58 @@ export namespace neutron { ..._198, ..._199, ..._200, - ..._521, - ..._527, - ..._533, - ..._539 + ..._201, + ..._535, + ..._541, + ..._547, + ..._553 }; export const feeburner = { - ..._201, ..._202, ..._203, ..._204, ..._205, - ..._522, - ..._528, - ..._534, - ..._540 + ..._206, + ..._536, + ..._542, + ..._548, + ..._554 }; export const feerefunder = { - ..._206, ..._207, ..._208, ..._209, ..._210, - ..._523, - ..._529, - ..._535, - ..._541 + ..._211, + ..._537, + ..._543, + ..._549, + ..._555 }; export const interchainqueries = { - ..._211, ..._212, ..._213, ..._214, - ..._524, - ..._530, - ..._536, - ..._542 + ..._215, + ..._538, + ..._544, + ..._550, + ..._556 }; export namespace interchaintxs { export const v1 = { - ..._215, ..._216, ..._217, ..._218, - ..._525, - ..._531, - ..._537, - ..._543 + ..._219, + ..._539, + ..._545, + ..._551, + ..._557 }; } export const ClientFactory = { - ..._690, - ..._691 + ..._708, + ..._709 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index 3aba99b29..24a595430 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _383 from "../tariff/genesis"; -import * as _384 from "../tariff/params"; -import * as _385 from "../tariff/query"; -import * as _667 from "../tariff/query.rpc.Query"; -import * as _704 from "./rpc.query"; +import * as _397 from "../tariff/genesis"; +import * as _398 from "../tariff/params"; +import * as _399 from "../tariff/query"; +import * as _685 from "../tariff/query.rpc.Query"; +import * as _724 from "./rpc.query"; export namespace noble { export const tariff = { - ..._383, - ..._384, - ..._385, - ..._667 + ..._397, + ..._398, + ..._399, + ..._685 }; export const ClientFactory = { - ..._704 + ..._724 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index a22d87c73..0849f86c9 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,166 +1,165 @@ -import * as _224 from "./accum/v1beta1/accum"; -import * as _225 from "./concentratedliquidity/params"; -import * as _226 from "./cosmwasmpool/v1beta1/genesis"; -import * as _227 from "./cosmwasmpool/v1beta1/gov"; -import * as _228 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _229 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _230 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _231 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _232 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _233 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _234 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _235 from "./cosmwasmpool/v1beta1/params"; -import * as _236 from "./cosmwasmpool/v1beta1/query"; -import * as _237 from "./cosmwasmpool/v1beta1/tx"; -import * as _238 from "./gamm/poolmodels/balancer/v1beta1/tx"; -import * as _239 from "./gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; -import * as _240 from "./gamm/poolmodels/stableswap/v1beta1/tx"; -import * as _241 from "./gamm/v1beta1/balancerPool"; -import * as _242 from "./gamm/v1beta1/genesis"; -import * as _243 from "./gamm/v1beta1/gov"; -import * as _244 from "./gamm/v1beta1/params"; -import * as _245 from "./gamm/v1beta1/query"; -import * as _246 from "./gamm/v1beta1/shared"; -import * as _247 from "./gamm/v1beta1/tx"; -import * as _248 from "./incentives/gauge"; -import * as _249 from "./incentives/genesis"; -import * as _250 from "./incentives/gov"; -import * as _251 from "./incentives/group"; -import * as _252 from "./incentives/params"; -import * as _253 from "./incentives/query"; -import * as _254 from "./incentives/tx"; -import * as _255 from "./lockup/genesis"; -import * as _256 from "./lockup/lock"; -import * as _257 from "./lockup/params"; -import * as _258 from "./lockup/query"; -import * as _259 from "./lockup/tx"; -import * as _260 from "./poolincentives/v1beta1/genesis"; -import * as _261 from "./poolincentives/v1beta1/gov"; -import * as _262 from "./poolincentives/v1beta1/incentives"; -import * as _263 from "./poolincentives/v1beta1/query"; -import * as _264 from "./poolincentives/v1beta1/shared"; -import * as _265 from "./poolmanager/v1beta1/genesis"; -import * as _266 from "./poolmanager/v1beta1/gov"; -import * as _267 from "./poolmanager/v1beta1/module_route"; -import * as _268 from "./poolmanager/v1beta1/query"; -import * as _269 from "./poolmanager/v1beta1/swap_route"; -import * as _270 from "./poolmanager/v1beta1/taker_fee_share"; -import * as _271 from "./poolmanager/v1beta1/tracked_volume"; -import * as _272 from "./poolmanager/v1beta1/tx"; -import * as _273 from "./protorev/v1beta1/genesis"; -import * as _274 from "./protorev/v1beta1/gov"; -import * as _275 from "./protorev/v1beta1/params"; -import * as _276 from "./protorev/v1beta1/protorev"; -import * as _277 from "./protorev/v1beta1/query"; -import * as _278 from "./protorev/v1beta1/tx"; -import * as _279 from "./smartaccount/v1beta1/genesis"; -import * as _280 from "./smartaccount/v1beta1/models"; -import * as _281 from "./smartaccount/v1beta1/params"; -import * as _282 from "./smartaccount/v1beta1/query"; -import * as _283 from "./smartaccount/v1beta1/tx"; -import * as _284 from "./superfluid/genesis"; -import * as _285 from "./superfluid/params"; -import * as _286 from "./superfluid/query"; -import * as _287 from "./superfluid/superfluid"; -import * as _288 from "./superfluid/tx"; -import * as _289 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _290 from "./tokenfactory/v1beta1/genesis"; -import * as _291 from "./tokenfactory/v1beta1/params"; -import * as _292 from "./tokenfactory/v1beta1/query"; -import * as _293 from "./tokenfactory/v1beta1/tx"; -import * as _294 from "./txfees/v1beta1/feetoken"; -import * as _295 from "./txfees/v1beta1/genesis"; -import * as _296 from "./txfees/v1beta1/gov"; -import * as _297 from "./txfees/v1beta1/params"; -import * as _298 from "./txfees/v1beta1/query"; -import * as _299 from "./txfees/v1beta1/tx"; -import * as _300 from "./valsetpref/v1beta1/query"; -import * as _301 from "./valsetpref/v1beta1/state"; -import * as _302 from "./valsetpref/v1beta1/tx"; -import * as _548 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _549 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _550 from "./gamm/poolmodels/balancer/v1beta1/tx.amino"; -import * as _551 from "./gamm/poolmodels/stableswap/v1beta1/tx.amino"; -import * as _552 from "./gamm/v1beta1/tx.amino"; -import * as _553 from "./incentives/tx.amino"; -import * as _554 from "./lockup/tx.amino"; -import * as _555 from "./poolmanager/v1beta1/tx.amino"; -import * as _556 from "./protorev/v1beta1/tx.amino"; -import * as _557 from "./smartaccount/v1beta1/tx.amino"; -import * as _558 from "./superfluid/tx.amino"; -import * as _559 from "./tokenfactory/v1beta1/tx.amino"; -import * as _560 from "./txfees/v1beta1/tx.amino"; -import * as _561 from "./valsetpref/v1beta1/tx.amino"; -import * as _562 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _563 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _564 from "./gamm/poolmodels/balancer/v1beta1/tx.registry"; -import * as _565 from "./gamm/poolmodels/stableswap/v1beta1/tx.registry"; -import * as _566 from "./gamm/v1beta1/tx.registry"; -import * as _567 from "./incentives/tx.registry"; -import * as _568 from "./lockup/tx.registry"; -import * as _569 from "./poolmanager/v1beta1/tx.registry"; -import * as _570 from "./protorev/v1beta1/tx.registry"; -import * as _571 from "./smartaccount/v1beta1/tx.registry"; -import * as _572 from "./superfluid/tx.registry"; -import * as _573 from "./tokenfactory/v1beta1/tx.registry"; -import * as _574 from "./txfees/v1beta1/tx.registry"; -import * as _575 from "./valsetpref/v1beta1/tx.registry"; -import * as _576 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _577 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _578 from "./gamm/v1beta1/query.rpc.Query"; -import * as _579 from "./incentives/query.rpc.Query"; -import * as _580 from "./lockup/query.rpc.Query"; -import * as _581 from "./poolincentives/v1beta1/query.rpc.Query"; -import * as _582 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _583 from "./protorev/v1beta1/query.rpc.Query"; -import * as _584 from "./smartaccount/v1beta1/query.rpc.Query"; -import * as _585 from "./superfluid/query.rpc.Query"; -import * as _586 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _587 from "./txfees/v1beta1/query.rpc.Query"; -import * as _588 from "./valsetpref/v1beta1/query.rpc.Query"; -import * as _589 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _590 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _591 from "./gamm/poolmodels/balancer/v1beta1/tx.rpc.msg"; -import * as _592 from "./gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg"; -import * as _593 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _594 from "./incentives/tx.rpc.msg"; -import * as _595 from "./lockup/tx.rpc.msg"; -import * as _596 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _597 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _598 from "./smartaccount/v1beta1/tx.rpc.msg"; -import * as _599 from "./superfluid/tx.rpc.msg"; -import * as _600 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _601 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _602 from "./valsetpref/v1beta1/tx.rpc.msg"; -import * as _694 from "./rpc.query"; -import * as _695 from "./rpc.tx"; +import * as _225 from "./accum/v1beta1/accum"; +import * as _226 from "./concentratedliquidity/params"; +import * as _227 from "./cosmwasmpool/v1beta1/genesis"; +import * as _228 from "./cosmwasmpool/v1beta1/gov"; +import * as _229 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _230 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _231 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _232 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _233 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _234 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _235 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _236 from "./cosmwasmpool/v1beta1/params"; +import * as _237 from "./cosmwasmpool/v1beta1/query"; +import * as _238 from "./cosmwasmpool/v1beta1/tx"; +import * as _239 from "./gamm/poolmodels/balancer/v1beta1/tx"; +import * as _240 from "./gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import * as _241 from "./gamm/poolmodels/stableswap/v1beta1/tx"; +import * as _242 from "./gamm/v1beta1/balancerPool"; +import * as _243 from "./gamm/v1beta1/genesis"; +import * as _244 from "./gamm/v1beta1/gov"; +import * as _245 from "./gamm/v1beta1/params"; +import * as _246 from "./gamm/v1beta1/query"; +import * as _247 from "./gamm/v1beta1/shared"; +import * as _248 from "./gamm/v1beta1/tx"; +import * as _249 from "./incentives/gauge"; +import * as _250 from "./incentives/genesis"; +import * as _251 from "./incentives/gov"; +import * as _252 from "./incentives/group"; +import * as _253 from "./incentives/params"; +import * as _254 from "./incentives/query"; +import * as _255 from "./incentives/tx"; +import * as _256 from "./lockup/genesis"; +import * as _257 from "./lockup/lock"; +import * as _258 from "./lockup/params"; +import * as _259 from "./lockup/query"; +import * as _260 from "./lockup/tx"; +import * as _261 from "./poolincentives/v1beta1/genesis"; +import * as _262 from "./poolincentives/v1beta1/gov"; +import * as _263 from "./poolincentives/v1beta1/incentives"; +import * as _264 from "./poolincentives/v1beta1/query"; +import * as _265 from "./poolincentives/v1beta1/shared"; +import * as _266 from "./poolmanager/v1beta1/genesis"; +import * as _267 from "./poolmanager/v1beta1/gov"; +import * as _268 from "./poolmanager/v1beta1/module_route"; +import * as _269 from "./poolmanager/v1beta1/query"; +import * as _270 from "./poolmanager/v1beta1/swap_route"; +import * as _271 from "./poolmanager/v1beta1/taker_fee_share"; +import * as _272 from "./poolmanager/v1beta1/tracked_volume"; +import * as _273 from "./poolmanager/v1beta1/tx"; +import * as _274 from "./protorev/v1beta1/genesis"; +import * as _275 from "./protorev/v1beta1/gov"; +import * as _276 from "./protorev/v1beta1/params"; +import * as _277 from "./protorev/v1beta1/protorev"; +import * as _278 from "./protorev/v1beta1/query"; +import * as _279 from "./protorev/v1beta1/tx"; +import * as _280 from "./smartaccount/v1beta1/genesis"; +import * as _281 from "./smartaccount/v1beta1/models"; +import * as _282 from "./smartaccount/v1beta1/params"; +import * as _283 from "./smartaccount/v1beta1/query"; +import * as _284 from "./smartaccount/v1beta1/tx"; +import * as _285 from "./superfluid/genesis"; +import * as _286 from "./superfluid/params"; +import * as _287 from "./superfluid/query"; +import * as _288 from "./superfluid/superfluid"; +import * as _289 from "./superfluid/tx"; +import * as _290 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _291 from "./tokenfactory/v1beta1/genesis"; +import * as _292 from "./tokenfactory/v1beta1/params"; +import * as _293 from "./tokenfactory/v1beta1/query"; +import * as _294 from "./tokenfactory/v1beta1/tx"; +import * as _295 from "./txfees/v1beta1/feetoken"; +import * as _296 from "./txfees/v1beta1/genesis"; +import * as _297 from "./txfees/v1beta1/gov"; +import * as _298 from "./txfees/v1beta1/params"; +import * as _299 from "./txfees/v1beta1/query"; +import * as _300 from "./txfees/v1beta1/tx"; +import * as _301 from "./valsetpref/v1beta1/query"; +import * as _302 from "./valsetpref/v1beta1/state"; +import * as _303 from "./valsetpref/v1beta1/tx"; +import * as _562 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _563 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _564 from "./gamm/poolmodels/balancer/v1beta1/tx.amino"; +import * as _565 from "./gamm/poolmodels/stableswap/v1beta1/tx.amino"; +import * as _566 from "./gamm/v1beta1/tx.amino"; +import * as _567 from "./incentives/tx.amino"; +import * as _568 from "./lockup/tx.amino"; +import * as _569 from "./poolmanager/v1beta1/tx.amino"; +import * as _570 from "./protorev/v1beta1/tx.amino"; +import * as _571 from "./smartaccount/v1beta1/tx.amino"; +import * as _572 from "./superfluid/tx.amino"; +import * as _573 from "./tokenfactory/v1beta1/tx.amino"; +import * as _574 from "./txfees/v1beta1/tx.amino"; +import * as _575 from "./valsetpref/v1beta1/tx.amino"; +import * as _576 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _577 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _578 from "./gamm/poolmodels/balancer/v1beta1/tx.registry"; +import * as _579 from "./gamm/poolmodels/stableswap/v1beta1/tx.registry"; +import * as _580 from "./gamm/v1beta1/tx.registry"; +import * as _581 from "./incentives/tx.registry"; +import * as _582 from "./lockup/tx.registry"; +import * as _583 from "./poolmanager/v1beta1/tx.registry"; +import * as _584 from "./protorev/v1beta1/tx.registry"; +import * as _585 from "./smartaccount/v1beta1/tx.registry"; +import * as _586 from "./superfluid/tx.registry"; +import * as _587 from "./tokenfactory/v1beta1/tx.registry"; +import * as _588 from "./txfees/v1beta1/tx.registry"; +import * as _589 from "./valsetpref/v1beta1/tx.registry"; +import * as _590 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _591 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _592 from "./gamm/v1beta1/query.rpc.Query"; +import * as _593 from "./incentives/query.rpc.Query"; +import * as _594 from "./lockup/query.rpc.Query"; +import * as _595 from "./poolincentives/v1beta1/query.rpc.Query"; +import * as _596 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _597 from "./protorev/v1beta1/query.rpc.Query"; +import * as _598 from "./smartaccount/v1beta1/query.rpc.Query"; +import * as _599 from "./superfluid/query.rpc.Query"; +import * as _600 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _601 from "./txfees/v1beta1/query.rpc.Query"; +import * as _602 from "./valsetpref/v1beta1/query.rpc.Query"; +import * as _603 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _604 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _605 from "./gamm/poolmodels/balancer/v1beta1/tx.rpc.msg"; +import * as _606 from "./gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg"; +import * as _607 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _608 from "./incentives/tx.rpc.msg"; +import * as _609 from "./lockup/tx.rpc.msg"; +import * as _610 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _611 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _612 from "./smartaccount/v1beta1/tx.rpc.msg"; +import * as _613 from "./superfluid/tx.rpc.msg"; +import * as _614 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _615 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _616 from "./valsetpref/v1beta1/tx.rpc.msg"; +import * as _712 from "./rpc.query"; +import * as _713 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._224 + ..._225 }; } export const concentratedliquidity = { - ..._225, + ..._226, poolmodel: { concentrated: { v1beta1: { - ..._548, ..._562, - ..._589 + ..._576, + ..._603 } } }, v1beta1: { - ..._549, ..._563, - ..._576, - ..._590 + ..._577, + ..._590, + ..._604 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._226, ..._227, ..._228, ..._229, @@ -172,80 +171,80 @@ export namespace osmosis { ..._235, ..._236, ..._237, - ..._577 + ..._238, + ..._591 }; } export namespace gamm { export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._238, - ..._550, + ..._239, ..._564, - ..._591 + ..._578, + ..._605 }; } export namespace stableswap { export const v1beta1 = { - ..._239, ..._240, - ..._551, + ..._241, ..._565, - ..._592 + ..._579, + ..._606 }; } } export const v1beta1 = { - ..._241, ..._242, ..._243, ..._244, ..._245, ..._246, ..._247, - ..._552, + ..._248, ..._566, - ..._578, - ..._593 + ..._580, + ..._592, + ..._607 }; } export const incentives = { - ..._248, ..._249, ..._250, ..._251, ..._252, ..._253, ..._254, - ..._553, + ..._255, ..._567, - ..._579, - ..._594 + ..._581, + ..._593, + ..._608 }; export const lockup = { - ..._255, ..._256, ..._257, ..._258, ..._259, - ..._554, + ..._260, ..._568, - ..._580, - ..._595 + ..._582, + ..._594, + ..._609 }; export namespace poolincentives { export const v1beta1 = { - ..._260, ..._261, ..._262, ..._263, ..._264, - ..._581 + ..._265, + ..._595 }; } export namespace poolmanager { export const v1beta1 = { - ..._265, ..._266, ..._267, ..._268, @@ -253,90 +252,91 @@ export namespace osmosis { ..._270, ..._271, ..._272, - ..._555, + ..._273, ..._569, - ..._582, - ..._596 + ..._583, + ..._596, + ..._610 }; } export namespace protorev { export const v1beta1 = { - ..._273, ..._274, ..._275, ..._276, ..._277, ..._278, - ..._556, + ..._279, ..._570, - ..._583, - ..._597 + ..._584, + ..._597, + ..._611 }; } export namespace smartaccount { export const v1beta1 = { - ..._279, ..._280, ..._281, ..._282, ..._283, - ..._557, + ..._284, ..._571, - ..._584, - ..._598 + ..._585, + ..._598, + ..._612 }; } export const superfluid = { - ..._284, ..._285, ..._286, ..._287, ..._288, - ..._558, + ..._289, ..._572, - ..._585, - ..._599 + ..._586, + ..._599, + ..._613 }; export namespace tokenfactory { export const v1beta1 = { - ..._289, ..._290, ..._291, ..._292, ..._293, - ..._559, + ..._294, ..._573, - ..._586, - ..._600 + ..._587, + ..._600, + ..._614 }; } export namespace txfees { export const v1beta1 = { - ..._294, ..._295, ..._296, ..._297, ..._298, ..._299, - ..._560, + ..._300, ..._574, - ..._587, - ..._601 + ..._588, + ..._601, + ..._615 }; } export namespace valsetpref { export const v1beta1 = { - ..._300, ..._301, ..._302, - ..._561, + ..._303, ..._575, - ..._588, - ..._602 + ..._589, + ..._602, + ..._616 }; } export const ClientFactory = { - ..._694, - ..._695 + ..._712, + ..._713 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts index 80251d003..f342c8d13 100644 --- a/packages/types/protobuf/codegen/pstake/bundle.ts +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -1,98 +1,98 @@ -import * as _303 from "./liquidstake/v1beta1/genesis"; -import * as _304 from "./liquidstake/v1beta1/liquidstake"; -import * as _305 from "./liquidstake/v1beta1/query"; -import * as _306 from "./liquidstake/v1beta1/tx"; -import * as _307 from "./liquidstakeibc/v1beta1/genesis"; -import * as _308 from "./liquidstakeibc/v1beta1/liquidstakeibc"; -import * as _309 from "./liquidstakeibc/v1beta1/msgs"; -import * as _310 from "./liquidstakeibc/v1beta1/params"; -import * as _311 from "./liquidstakeibc/v1beta1/query"; -import * as _312 from "./lscosmos/v1beta1/genesis"; -import * as _313 from "./lscosmos/v1beta1/governance_proposal"; -import * as _314 from "./lscosmos/v1beta1/lscosmos"; -import * as _315 from "./lscosmos/v1beta1/msgs"; -import * as _316 from "./lscosmos/v1beta1/params"; -import * as _317 from "./lscosmos/v1beta1/query"; -import * as _318 from "./ratesync/v1beta1/contract"; -import * as _319 from "./ratesync/v1beta1/genesis"; -import * as _320 from "./ratesync/v1beta1/params"; -import * as _321 from "./ratesync/v1beta1/query"; -import * as _322 from "./ratesync/v1beta1/ratesync"; -import * as _323 from "./ratesync/v1beta1/tx"; -import * as _603 from "./liquidstake/v1beta1/tx.amino"; -import * as _604 from "./liquidstakeibc/v1beta1/msgs.amino"; -import * as _605 from "./lscosmos/v1beta1/msgs.amino"; -import * as _606 from "./ratesync/v1beta1/tx.amino"; -import * as _607 from "./liquidstake/v1beta1/tx.registry"; -import * as _608 from "./liquidstakeibc/v1beta1/msgs.registry"; -import * as _609 from "./lscosmos/v1beta1/msgs.registry"; -import * as _610 from "./ratesync/v1beta1/tx.registry"; -import * as _611 from "./liquidstake/v1beta1/query.rpc.Query"; -import * as _612 from "./liquidstakeibc/v1beta1/query.rpc.Query"; -import * as _613 from "./lscosmos/v1beta1/query.rpc.Query"; -import * as _614 from "./ratesync/v1beta1/query.rpc.Query"; -import * as _615 from "./liquidstake/v1beta1/tx.rpc.msg"; -import * as _616 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; -import * as _617 from "./lscosmos/v1beta1/msgs.rpc.msg"; -import * as _618 from "./ratesync/v1beta1/tx.rpc.msg"; -import * as _696 from "./rpc.query"; -import * as _697 from "./rpc.tx"; +import * as _304 from "./liquidstake/v1beta1/genesis"; +import * as _305 from "./liquidstake/v1beta1/liquidstake"; +import * as _306 from "./liquidstake/v1beta1/query"; +import * as _307 from "./liquidstake/v1beta1/tx"; +import * as _308 from "./liquidstakeibc/v1beta1/genesis"; +import * as _309 from "./liquidstakeibc/v1beta1/liquidstakeibc"; +import * as _310 from "./liquidstakeibc/v1beta1/msgs"; +import * as _311 from "./liquidstakeibc/v1beta1/params"; +import * as _312 from "./liquidstakeibc/v1beta1/query"; +import * as _313 from "./lscosmos/v1beta1/genesis"; +import * as _314 from "./lscosmos/v1beta1/governance_proposal"; +import * as _315 from "./lscosmos/v1beta1/lscosmos"; +import * as _316 from "./lscosmos/v1beta1/msgs"; +import * as _317 from "./lscosmos/v1beta1/params"; +import * as _318 from "./lscosmos/v1beta1/query"; +import * as _319 from "./ratesync/v1beta1/contract"; +import * as _320 from "./ratesync/v1beta1/genesis"; +import * as _321 from "./ratesync/v1beta1/params"; +import * as _322 from "./ratesync/v1beta1/query"; +import * as _323 from "./ratesync/v1beta1/ratesync"; +import * as _324 from "./ratesync/v1beta1/tx"; +import * as _617 from "./liquidstake/v1beta1/tx.amino"; +import * as _618 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _619 from "./lscosmos/v1beta1/msgs.amino"; +import * as _620 from "./ratesync/v1beta1/tx.amino"; +import * as _621 from "./liquidstake/v1beta1/tx.registry"; +import * as _622 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _623 from "./lscosmos/v1beta1/msgs.registry"; +import * as _624 from "./ratesync/v1beta1/tx.registry"; +import * as _625 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _626 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _627 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _628 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _629 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _630 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _631 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _632 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _714 from "./rpc.query"; +import * as _715 from "./rpc.tx"; export namespace pstake { export namespace liquidstake { export const v1beta1 = { - ..._303, ..._304, ..._305, ..._306, - ..._603, - ..._607, - ..._611, - ..._615 + ..._307, + ..._617, + ..._621, + ..._625, + ..._629 }; } export namespace liquidstakeibc { export const v1beta1 = { - ..._307, ..._308, ..._309, ..._310, ..._311, - ..._604, - ..._608, - ..._612, - ..._616 + ..._312, + ..._618, + ..._622, + ..._626, + ..._630 }; } export namespace lscosmos { export const v1beta1 = { - ..._312, ..._313, ..._314, ..._315, ..._316, ..._317, - ..._605, - ..._609, - ..._613, - ..._617 + ..._318, + ..._619, + ..._623, + ..._627, + ..._631 }; } export namespace ratesync { export const v1beta1 = { - ..._318, ..._319, ..._320, ..._321, ..._322, ..._323, - ..._606, - ..._610, - ..._614, - ..._618 + ..._324, + ..._620, + ..._624, + ..._628, + ..._632 }; } export const ClientFactory = { - ..._696, - ..._697 + ..._714, + ..._715 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index 411b6e122..73c918bb4 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _324 from "./stargaze/alloc/v1beta1/genesis"; -import * as _325 from "./stargaze/alloc/v1beta1/params"; -import * as _326 from "./stargaze/alloc/v1beta1/query"; -import * as _327 from "./stargaze/alloc/v1beta1/tx"; -import * as _328 from "./stargaze/cron/v1/cron"; -import * as _329 from "./stargaze/cron/v1/genesis"; -import * as _330 from "./stargaze/cron/v1/proposal"; -import * as _331 from "./stargaze/cron/v1/query"; -import * as _332 from "./stargaze/cron/v1/tx"; -import * as _333 from "./stargaze/globalfee/v1/genesis"; -import * as _334 from "./stargaze/globalfee/v1/globalfee"; -import * as _335 from "./stargaze/globalfee/v1/proposal"; -import * as _336 from "./stargaze/globalfee/v1/query"; -import * as _337 from "./stargaze/globalfee/v1/tx"; -import * as _338 from "./stargaze/mint/v1beta1/genesis"; -import * as _339 from "./stargaze/mint/v1beta1/mint"; -import * as _340 from "./stargaze/mint/v1beta1/query"; -import * as _341 from "./stargaze/mint/v1beta1/tx"; -import * as _619 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _620 from "./stargaze/cron/v1/tx.amino"; -import * as _621 from "./stargaze/globalfee/v1/tx.amino"; -import * as _622 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _623 from "./stargaze/cron/v1/tx.registry"; -import * as _624 from "./stargaze/globalfee/v1/tx.registry"; -import * as _625 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _626 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _627 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _628 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _629 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _630 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _631 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _698 from "./rpc.query"; -import * as _699 from "./rpc.tx"; +import * as _325 from "./stargaze/alloc/v1beta1/genesis"; +import * as _326 from "./stargaze/alloc/v1beta1/params"; +import * as _327 from "./stargaze/alloc/v1beta1/query"; +import * as _328 from "./stargaze/alloc/v1beta1/tx"; +import * as _329 from "./stargaze/cron/v1/cron"; +import * as _330 from "./stargaze/cron/v1/genesis"; +import * as _331 from "./stargaze/cron/v1/proposal"; +import * as _332 from "./stargaze/cron/v1/query"; +import * as _333 from "./stargaze/cron/v1/tx"; +import * as _334 from "./stargaze/globalfee/v1/genesis"; +import * as _335 from "./stargaze/globalfee/v1/globalfee"; +import * as _336 from "./stargaze/globalfee/v1/proposal"; +import * as _337 from "./stargaze/globalfee/v1/query"; +import * as _338 from "./stargaze/globalfee/v1/tx"; +import * as _339 from "./stargaze/mint/v1beta1/genesis"; +import * as _340 from "./stargaze/mint/v1beta1/mint"; +import * as _341 from "./stargaze/mint/v1beta1/query"; +import * as _342 from "./stargaze/mint/v1beta1/tx"; +import * as _633 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _634 from "./stargaze/cron/v1/tx.amino"; +import * as _635 from "./stargaze/globalfee/v1/tx.amino"; +import * as _636 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _637 from "./stargaze/cron/v1/tx.registry"; +import * as _638 from "./stargaze/globalfee/v1/tx.registry"; +import * as _639 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _640 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _641 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _642 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _643 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _644 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _645 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _716 from "./rpc.query"; +import * as _717 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._324, ..._325, ..._326, ..._327, - ..._619, - ..._622, - ..._625, - ..._629 + ..._328, + ..._633, + ..._636, + ..._639, + ..._643 }; } export namespace cron { export const v1 = { - ..._328, ..._329, ..._330, ..._331, ..._332, - ..._620, - ..._623, - ..._626, - ..._630 + ..._333, + ..._634, + ..._637, + ..._640, + ..._644 }; } export namespace globalfee { export const v1 = { - ..._333, ..._334, ..._335, ..._336, ..._337, - ..._621, - ..._624, - ..._627, - ..._631 + ..._338, + ..._635, + ..._638, + ..._641, + ..._645 }; } export namespace mint { export const v1beta1 = { - ..._338, ..._339, ..._340, ..._341, - ..._628 + ..._342, + ..._642 }; } } export const ClientFactory = { - ..._698, - ..._699 + ..._716, + ..._717 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index 5f0ae6311..e9b5dea00 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _342 from "./data/v1/events"; -import * as _343 from "./data/v1/state"; -import * as _344 from "./data/v1/tx"; -import * as _345 from "./data/v1/types"; -import * as _346 from "./data/v2/events"; -import * as _347 from "./data/v2/state"; -import * as _348 from "./data/v2/tx"; -import * as _349 from "./data/v2/types"; -import * as _350 from "./ecocredit/basket/v1/events"; -import * as _351 from "./ecocredit/basket/v1/state"; -import * as _352 from "./ecocredit/basket/v1/tx"; -import * as _353 from "./ecocredit/basket/v1/types"; -import * as _354 from "./ecocredit/marketplace/v1/events"; -import * as _355 from "./ecocredit/marketplace/v1/state"; -import * as _356 from "./ecocredit/marketplace/v1/tx"; -import * as _357 from "./ecocredit/marketplace/v1/types"; -import * as _358 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _359 from "./ecocredit/v1/events"; -import * as _360 from "./ecocredit/v1/state"; -import * as _361 from "./ecocredit/v1/tx"; -import * as _362 from "./ecocredit/v1/types"; -import * as _363 from "./ecocredit/v1alpha1/events"; -import * as _364 from "./ecocredit/v1alpha1/genesis"; -import * as _365 from "./ecocredit/v1alpha1/tx"; -import * as _366 from "./ecocredit/v1alpha1/types"; -import * as _367 from "./intertx/v1/query"; -import * as _368 from "./intertx/v1/tx"; -import * as _632 from "./data/v1/tx.amino"; -import * as _633 from "./data/v2/tx.amino"; -import * as _634 from "./ecocredit/basket/v1/tx.amino"; -import * as _635 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _636 from "./ecocredit/v1/tx.amino"; -import * as _637 from "./ecocredit/v1alpha1/tx.amino"; -import * as _638 from "./intertx/v1/tx.amino"; -import * as _639 from "./data/v1/tx.registry"; -import * as _640 from "./data/v2/tx.registry"; -import * as _641 from "./ecocredit/basket/v1/tx.registry"; -import * as _642 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _643 from "./ecocredit/v1/tx.registry"; -import * as _644 from "./ecocredit/v1alpha1/tx.registry"; -import * as _645 from "./intertx/v1/tx.registry"; -import * as _646 from "./intertx/v1/query.rpc.Query"; -import * as _647 from "./data/v1/tx.rpc.msg"; -import * as _648 from "./data/v2/tx.rpc.msg"; -import * as _649 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _650 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _651 from "./ecocredit/v1/tx.rpc.msg"; -import * as _652 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _653 from "./intertx/v1/tx.rpc.msg"; -import * as _700 from "./rpc.query"; -import * as _701 from "./rpc.tx"; +import * as _343 from "./data/v1/events"; +import * as _344 from "./data/v1/state"; +import * as _345 from "./data/v1/tx"; +import * as _346 from "./data/v1/types"; +import * as _347 from "./data/v2/events"; +import * as _348 from "./data/v2/state"; +import * as _349 from "./data/v2/tx"; +import * as _350 from "./data/v2/types"; +import * as _351 from "./ecocredit/basket/v1/events"; +import * as _352 from "./ecocredit/basket/v1/state"; +import * as _353 from "./ecocredit/basket/v1/tx"; +import * as _354 from "./ecocredit/basket/v1/types"; +import * as _355 from "./ecocredit/marketplace/v1/events"; +import * as _356 from "./ecocredit/marketplace/v1/state"; +import * as _357 from "./ecocredit/marketplace/v1/tx"; +import * as _358 from "./ecocredit/marketplace/v1/types"; +import * as _359 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _360 from "./ecocredit/v1/events"; +import * as _361 from "./ecocredit/v1/state"; +import * as _362 from "./ecocredit/v1/tx"; +import * as _363 from "./ecocredit/v1/types"; +import * as _364 from "./ecocredit/v1alpha1/events"; +import * as _365 from "./ecocredit/v1alpha1/genesis"; +import * as _366 from "./ecocredit/v1alpha1/tx"; +import * as _367 from "./ecocredit/v1alpha1/types"; +import * as _368 from "./intertx/v1/query"; +import * as _369 from "./intertx/v1/tx"; +import * as _646 from "./data/v1/tx.amino"; +import * as _647 from "./data/v2/tx.amino"; +import * as _648 from "./ecocredit/basket/v1/tx.amino"; +import * as _649 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _650 from "./ecocredit/v1/tx.amino"; +import * as _651 from "./ecocredit/v1alpha1/tx.amino"; +import * as _652 from "./intertx/v1/tx.amino"; +import * as _653 from "./data/v1/tx.registry"; +import * as _654 from "./data/v2/tx.registry"; +import * as _655 from "./ecocredit/basket/v1/tx.registry"; +import * as _656 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _657 from "./ecocredit/v1/tx.registry"; +import * as _658 from "./ecocredit/v1alpha1/tx.registry"; +import * as _659 from "./intertx/v1/tx.registry"; +import * as _660 from "./intertx/v1/query.rpc.Query"; +import * as _661 from "./data/v1/tx.rpc.msg"; +import * as _662 from "./data/v2/tx.rpc.msg"; +import * as _663 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _664 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _665 from "./ecocredit/v1/tx.rpc.msg"; +import * as _666 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _667 from "./intertx/v1/tx.rpc.msg"; +import * as _718 from "./rpc.query"; +import * as _719 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._342, ..._343, ..._344, ..._345, - ..._632, - ..._639, - ..._647 + ..._346, + ..._646, + ..._653, + ..._661 }; export const v2 = { - ..._346, ..._347, ..._348, ..._349, - ..._633, - ..._640, - ..._648 + ..._350, + ..._647, + ..._654, + ..._662 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._350, ..._351, ..._352, ..._353, - ..._634, - ..._641, - ..._649 + ..._354, + ..._648, + ..._655, + ..._663 }; } export namespace marketplace { export const v1 = { - ..._354, ..._355, ..._356, ..._357, - ..._635, - ..._642, - ..._650 + ..._358, + ..._649, + ..._656, + ..._664 }; } export namespace orderbook { export const v1alpha1 = { - ..._358 + ..._359 }; } export const v1 = { - ..._359, ..._360, ..._361, ..._362, - ..._636, - ..._643, - ..._651 + ..._363, + ..._650, + ..._657, + ..._665 }; export const v1alpha1 = { - ..._363, ..._364, ..._365, ..._366, - ..._637, - ..._644, - ..._652 + ..._367, + ..._651, + ..._658, + ..._666 }; } export namespace intertx { export const v1 = { - ..._367, ..._368, - ..._638, - ..._645, - ..._646, - ..._653 + ..._369, + ..._652, + ..._659, + ..._660, + ..._667 }; } export const ClientFactory = { - ..._700, - ..._701 + ..._718, + ..._719 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/bundle.ts b/packages/types/protobuf/codegen/secret/bundle.ts index 325baa001..7fd633fc1 100644 --- a/packages/types/protobuf/codegen/secret/bundle.ts +++ b/packages/types/protobuf/codegen/secret/bundle.ts @@ -1,78 +1,78 @@ -import * as _369 from "./compute/v1beta1/genesis"; -import * as _370 from "./compute/v1beta1/msg"; -import * as _371 from "./compute/v1beta1/query"; -import * as _372 from "./compute/v1beta1/types"; -import * as _373 from "./emergencybutton/v1beta1/genesis"; -import * as _374 from "./emergencybutton/v1beta1/params"; -import * as _375 from "./emergencybutton/v1beta1/query"; -import * as _376 from "./emergencybutton/v1beta1/tx"; -import * as _377 from "./intertx/v1beta1/query"; -import * as _378 from "./intertx/v1beta1/tx"; -import * as _379 from "./registration/v1beta1/genesis"; -import * as _380 from "./registration/v1beta1/msg"; -import * as _381 from "./registration/v1beta1/query"; -import * as _382 from "./registration/v1beta1/types"; -import * as _654 from "./compute/v1beta1/msg.amino"; -import * as _655 from "./emergencybutton/v1beta1/tx.amino"; -import * as _656 from "./intertx/v1beta1/tx.amino"; -import * as _657 from "./compute/v1beta1/msg.registry"; -import * as _658 from "./emergencybutton/v1beta1/tx.registry"; -import * as _659 from "./intertx/v1beta1/tx.registry"; -import * as _660 from "./compute/v1beta1/query.rpc.Query"; -import * as _661 from "./emergencybutton/v1beta1/query.rpc.Query"; -import * as _662 from "./intertx/v1beta1/query.rpc.Query"; -import * as _663 from "./registration/v1beta1/query.rpc.Query"; -import * as _664 from "./compute/v1beta1/msg.rpc.msg"; -import * as _665 from "./emergencybutton/v1beta1/tx.rpc.msg"; -import * as _666 from "./intertx/v1beta1/tx.rpc.msg"; -import * as _702 from "./rpc.query"; -import * as _703 from "./rpc.tx"; +import * as _370 from "./compute/v1beta1/genesis"; +import * as _371 from "./compute/v1beta1/msg"; +import * as _372 from "./compute/v1beta1/query"; +import * as _373 from "./compute/v1beta1/types"; +import * as _374 from "./emergencybutton/v1beta1/genesis"; +import * as _375 from "./emergencybutton/v1beta1/params"; +import * as _376 from "./emergencybutton/v1beta1/query"; +import * as _377 from "./emergencybutton/v1beta1/tx"; +import * as _378 from "./intertx/v1beta1/query"; +import * as _379 from "./intertx/v1beta1/tx"; +import * as _380 from "./registration/v1beta1/genesis"; +import * as _381 from "./registration/v1beta1/msg"; +import * as _382 from "./registration/v1beta1/query"; +import * as _383 from "./registration/v1beta1/types"; +import * as _668 from "./compute/v1beta1/msg.amino"; +import * as _669 from "./emergencybutton/v1beta1/tx.amino"; +import * as _670 from "./intertx/v1beta1/tx.amino"; +import * as _671 from "./compute/v1beta1/msg.registry"; +import * as _672 from "./emergencybutton/v1beta1/tx.registry"; +import * as _673 from "./intertx/v1beta1/tx.registry"; +import * as _674 from "./compute/v1beta1/query.rpc.Query"; +import * as _675 from "./emergencybutton/v1beta1/query.rpc.Query"; +import * as _676 from "./intertx/v1beta1/query.rpc.Query"; +import * as _677 from "./registration/v1beta1/query.rpc.Query"; +import * as _678 from "./compute/v1beta1/msg.rpc.msg"; +import * as _679 from "./emergencybutton/v1beta1/tx.rpc.msg"; +import * as _680 from "./intertx/v1beta1/tx.rpc.msg"; +import * as _720 from "./rpc.query"; +import * as _721 from "./rpc.tx"; export namespace secret { export namespace compute { export const v1beta1 = { - ..._369, ..._370, ..._371, ..._372, - ..._654, - ..._657, - ..._660, - ..._664 + ..._373, + ..._668, + ..._671, + ..._674, + ..._678 }; } export namespace emergencybutton { export const v1beta1 = { - ..._373, ..._374, ..._375, ..._376, - ..._655, - ..._658, - ..._661, - ..._665 + ..._377, + ..._669, + ..._672, + ..._675, + ..._679 }; } export namespace intertx { export const v1beta1 = { - ..._377, ..._378, - ..._656, - ..._659, - ..._662, - ..._666 + ..._379, + ..._670, + ..._673, + ..._676, + ..._680 }; } export namespace registration { export const v1beta1 = { - ..._379, ..._380, ..._381, ..._382, - ..._663 + ..._383, + ..._677 }; } export const ClientFactory = { - ..._702, - ..._703 + ..._720, + ..._721 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index 42bfcd3cb..b945c9fca 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _386 from "./abci/types"; -import * as _387 from "./crypto/keys"; -import * as _388 from "./crypto/proof"; -import * as _389 from "./p2p/types"; -import * as _390 from "./types/block"; -import * as _391 from "./types/evidence"; -import * as _392 from "./types/params"; -import * as _393 from "./types/types"; -import * as _394 from "./types/validator"; -import * as _395 from "./version/types"; +import * as _400 from "./abci/types"; +import * as _401 from "./crypto/keys"; +import * as _402 from "./crypto/proof"; +import * as _403 from "./p2p/types"; +import * as _404 from "./types/block"; +import * as _405 from "./types/evidence"; +import * as _406 from "./types/params"; +import * as _407 from "./types/types"; +import * as _408 from "./types/validator"; +import * as _409 from "./version/types"; export namespace tendermint { export const abci = { - ..._386 + ..._400 }; export const crypto = { - ..._387, - ..._388 + ..._401, + ..._402 }; export const p2p = { - ..._389 + ..._403 }; export const types = { - ..._390, - ..._391, - ..._392, - ..._393, - ..._394 + ..._404, + ..._405, + ..._406, + ..._407, + ..._408 }; export const version = { - ..._395 + ..._409 }; } \ No newline at end of file diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/asset_params.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/asset_params.proto new file mode 100644 index 000000000..cc79748a4 --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/asset_params.proto @@ -0,0 +1,85 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "google/protobuf/wrappers.proto"; +import "gogoproto/gogo.proto"; +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; +option (gogoproto.goproto_getters_all) = false; + +message AssetParamsAPI { + AssetParams asset_params = 1; + string token_name = 2; +} + +message AssetParams { + string denom = 1; + reserved 2; // deprecated: oracle_id is now on pricing + string rate_strategy_name = 3; + bool allow_repay_stablecoin_interest = 4; + string loan_to_value = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string liquidation_threshold = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string liquidation_discount = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string supply_cap = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string borrow_cap = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; +} + +message AssetUtilization { + string denom = 1; + string total_borrowed = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string total_amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string utilization_rate = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} + +message UpdateAssetParams { + string denom = 1; + google.protobuf.StringValue rate_strategy_name = 2 + [ (gogoproto.wktpointer) = true ]; + google.protobuf.BoolValue allow_repay_stablecoin_interest = 3 + [ (gogoproto.wktpointer) = true ]; + string loan_to_value = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string liquidation_threshold = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string liquidation_discount = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string supply_cap = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string borrow_cap = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/cdp_liquidations.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/cdp_liquidations.proto new file mode 100644 index 000000000..1b97bd9b1 --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/cdp_liquidations.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; +option (gogoproto.goproto_getters_all) = false; + +message CDPLiquidations { + uint64 id = 1 [ (gogoproto.moretags) = "db:\"id\"" ]; + string liquidator = 2 [ + (gogoproto.moretags) = "db:\"liquidator\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + string debtor = 3 [ + (gogoproto.moretags) = "db:\"debtor\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + string collateral_denom = 4 + [ (gogoproto.moretags) = "db:\"collateral_denom\"" ]; + string collateral_amount_liquidated = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "db:\"collateral_amount_liquidated\"", + (gogoproto.nullable) = false + ]; + string collateral_amount_liquidator = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "db:\"collateral_amount_liquidator\"", + (gogoproto.nullable) = false + ]; + string collateral_amount_fee = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "db:\"collateral_amount_fee\"", + (gogoproto.nullable) = false + ]; + string liquidation_price = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "db:\"liquidation_price\"", + (gogoproto.nullable) = false + ]; + string market_price = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "db:\"market_price\"", + (gogoproto.nullable) = false + ]; + string discount = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.moretags) = "db:\"discount\"", + (gogoproto.nullable) = false + ]; + string debt_denom = 11 [ (gogoproto.moretags) = "db:\"debt_denom\"" ]; + string debt_amount = 12 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.moretags) = "db:\"debt_amount\"", + (gogoproto.nullable) = false + ]; + int64 block_height = 13 [ (gogoproto.moretags) = "db:\"block_height\"" ]; + google.protobuf.Timestamp block_time = 14 [ + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "db:\"block_time\"", + (gogoproto.nullable) = false + ]; + string transaction_hash = 15 + [ (gogoproto.moretags) = "db:\"transaction_hash\"" ]; +} diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/debt_info.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/debt_info.proto new file mode 100644 index 000000000..61c26d562 --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/debt_info.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; + +message DebtInfo { + string denom = 1; + google.protobuf.Timestamp last_updated_time = 2 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + string total_principal = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string cumulative_interest_multiplier = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string total_accumulated_interest = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string utilization_rate = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/e_mode_category.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/e_mode_category.proto new file mode 100644 index 000000000..ce3178b80 --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/e_mode_category.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; +option (gogoproto.goproto_getters_all) = false; + +message EModeCategory { + string name = 1; + repeated string denoms = 2; + string loan_to_value = 3 [ (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; + string liquidation_threshold = 4 + [ (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; + string liquidation_discount = 5 + [ (gogoproto.customtype) = "cosmossdk.io/math.Int" ]; + bool is_active = 6; +} diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/event.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/event.proto new file mode 100644 index 000000000..17acfad07 --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/event.proto @@ -0,0 +1,365 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "gogoproto/gogo.proto"; +import "Switcheo/carbon/cdp/debt_info.proto"; +import "Switcheo/carbon/cdp/stablecoin_debt_info.proto"; +import "Switcheo/carbon/cdp/rate_strategy_params.proto"; +import "Switcheo/carbon/cdp/asset_params.proto"; +import "Switcheo/carbon/cdp/reward_scheme.proto"; +import "Switcheo/carbon/cdp/e_mode_category.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; +option (gogoproto.goproto_getters_all) = false; + +message NewRateStrategyParamsEvent { + RateStrategyParams rate_strategy_params = 1 [ (gogoproto.nullable) = false ]; + string type = 2; +} + +message UpdateRateStrategyParamsEvent { + RateStrategyParams rate_strategy_params = 1 [ (gogoproto.nullable) = false ]; + string type = 2; +} + +message RemoveRateStrategyParamsEvent { + RateStrategyParams rate_strategy_params = 1 [ (gogoproto.nullable) = false ]; + string type = 2; +} + +message NewAssetParamsEvent { + AssetParams asset_params = 1 [ (gogoproto.nullable) = false ]; + string type = 2; +} + +message UpdateAssetParamsEvent { + AssetParams asset_params = 1 [ (gogoproto.nullable) = false ]; + string type = 2; +} + +message NewEModeCategoryEvent { + EModeCategory e_mode_category = 1 [ (gogoproto.nullable) = false ]; + string type = 2; +} + +message UpdateEModeCategoryEvent { + EModeCategory e_mode_category = 1 [ (gogoproto.nullable) = false ]; + string type = 2; +} + +message UpdateAccountEModeCategoryNameEvent { + string account = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string e_mode_category_name = 2; +} + +message SetInterestFeeEvent { + string interest_fee = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string type = 2; +} + +message SetLiquidationFeeEvent { + string liquidation_fee = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string type = 2; +} + +message SetStablecoinInterestRateEvent { + // Deprecated for stablecoin_interest_rate_dec + string stablecoin_interest_rate = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string type = 2; + string stablecoin_interest_rate_dec = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message SetStablecoinMintCapEvent { + string stablecoin_mint_cap = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string type = 2; +} + +message SetCompleteLiquidationThresholdEvent { + string complete_liquidation_threshold = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string type = 2; +} + +message SetMinimumCloseFactorEvent { + string minimum_close_factor = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string type = 2; +} + +message SetSmallLiquidationSizeEvent { + string small_liquidation_size = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string type = 2; +} + +message SetStalePriceGracePeriodEvent { + google.protobuf.Duration stale_price_grace_period = 1 + [ (gogoproto.stdduration) = true, (gogoproto.nullable) = false ]; + string type = 2; +} + +message SetCdpPausedEvent { + bool cdp_paused = 1; + string type = 2; +} + +message SupplyAssetEvent { + string supplier = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string denom = 2; + string amount_supplied = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string cibt_denom = 4; + string amount_minted = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message WithdrawAssetEvent { + string withdrawer = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string denom = 2; + string amount_withdrawed = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string cibt_denom = 4; + string amount_burned = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message BorrowAssetEvent { + string borrower = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string denom = 2; + string amount_borrowed = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string debt_value = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string collateral_value = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string initial_cumulative_interest_multiplier = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message RepayAssetEvent { + string repayer = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string debtor = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string denom = 3; + string principal_repaid = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string interest_repaid = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string debt_value = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string collateral_value = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message LockCollateralEvent { + string locker = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string cibt_denom = 2; + string amount_locked = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string debt_value = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string collateral_value = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message UnlockCollateralEvent { + string unlocker = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string cibt_denom = 2; + string amount_unlocked = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string debt_value = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string collateral_value = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message UpdateDebtInfoEvent { + DebtInfo debt_info = 1 [ (gogoproto.nullable) = false ]; + string type = 2; +} + +message UpdateStablecoinDebtInfoEvent { + StablecoinDebtInfo stablecoin_debt_info = 1 [ (gogoproto.nullable) = false ]; + string type = 2; +} + +message MintStablecoinEvent { + string minter = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string denom = 2; + string amount_minted = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string debt_value = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string collateral_value = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string initial_cumulative_interest_multiplier = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message ReturnStablecoinEvent { + string returner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string debtor = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string interest_denom = 3; + string interest_repaid = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string principal_repaid = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string debt_value = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string collateral_value = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message LiquidateCollateralEvent { + string liquidator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string debtor = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string collateral_denom = 3; + string collateral_amount_liquidated = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string collateral_amount_liquidator = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string collateral_amount_fee = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string liquidation_price = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string market_price = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string discount = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string debt_denom = 10; + string debt_amount = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + uint64 id = 12 [ (gogoproto.moretags) = "yaml:\"id\"" ]; + string principal_amount = 13 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string interest_denom = 14; + string interest_amount = 15 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message ClaimRewardEvent { + string receiver = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string reward_scheme_id = 2; + string reward_claimed = 3 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; +} + +message RewardDebtEvent { + RewardDebt reward_debt = 1; + string type = 2; +} + +message RewardSchemeEvent { + RewardScheme reward_scheme = 1; + string type = 2; +} + +message AddReserveEvent { + RewardScheme reward_scheme = 1; + string amount_added = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; +} + +message RefundReserveEvent { + RewardScheme reward_scheme = 1; + string amount_refunded = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/genesis.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/genesis.proto new file mode 100644 index 000000000..78e7bbfb7 --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/genesis.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "gogoproto/gogo.proto"; +import "Switcheo/carbon/cdp/params.proto"; +import "Switcheo/carbon/cdp/debt_info.proto"; +import "Switcheo/carbon/cdp/stablecoin_debt_info.proto"; +import "Switcheo/carbon/cdp/rate_strategy_params.proto"; +import "Switcheo/carbon/cdp/asset_params.proto"; +import "Switcheo/carbon/cdp/reward_scheme.proto"; +import "Switcheo/carbon/cdp/e_mode_category.proto"; +import "Switcheo/carbon/cdp/stablecoin_interest_info.proto"; +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; +option (gogoproto.goproto_getters_all) = false; + +// GenesisState defines the cdp module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + repeated RateStrategyParams rate_strategies = 2 + [ (gogoproto.nullable) = false ]; + repeated AssetParams assets = 3 [ (gogoproto.nullable) = false ]; + repeated DebtInfo debt_infos = 4 [ (gogoproto.nullable) = false ]; + repeated RewardScheme reward_schemes = 5 [ (gogoproto.nullable) = false ]; + uint64 sequence_number = 6; + map collateralized_cibt_records = 7; + map principal_records = 8; + map initial_cumulative_interest_multiplier_records = 9; + StablecoinDebtInfo stablecoin_debt_info = 10 [ (gogoproto.nullable) = false ]; + map principal_stablecoin_debt_records = 11; + map stablecoin_initial_cumulative_interest_multiplier_records = + 12; + map reward_debt_records = 13; + StablecoinInterestInfo stablecoin_interest_info = 14 + [ (gogoproto.nullable) = false ]; + repeated EModeCategory e_mode_categories = 15 + [ (gogoproto.nullable) = false ]; + map account_e_mode_category_records = 16; + // this line is used by starport scaffolding # genesis/proto/state +} diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/params.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/params.proto new file mode 100644 index 000000000..e2a8018a3 --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/params.proto @@ -0,0 +1,121 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "google/protobuf/wrappers.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; +option (gogoproto.goproto_getters_all) = false; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; + string interest_fee = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string liquidation_fee = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + reserved 3; // used to be stablecoin_interest_rate, but deprecated + string stablecoin_mint_cap = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // Complete Liquidation Threshold determines how far between + // liquidation_threshold (LT) and collateral_value (CV) a borrower's + // borrowed value must have progressed in order to allow a full liquidation. + // 0.3 indicates 30% of the way from LT to CV. + // Valid values: 0-1. + string complete_liquidation_threshold = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // Close Factor determines the portion of a borrower's position that can be + // liquidated in a single event. Minimum Close Factor is Close Factor at + // liquidation_threshold. 0.1 means that that 10% of the borrower position can + // be liquidated when the borrowed value passes the liquidation_threshold. + // close_factor scales linearly between minimum_close_factor and 1.0, + // reaching its maximum when borrowed value passes + // complete_liquidation_threshold. We can put it into the picture: + // + // borrowed C := collateral + // value value + // --- | ------- | ----- | -------- | -------> + // L CL + // + // liquidation = liquidation_threshold * C + // CL = L + (C-CL) * complete_liquidation_threshold + // is the borrowed value above which close factor will be 1. + // + // Valid values: 0-1. + string minimum_close_factor = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // Small Liquidation Size determines the USD value at which a borrow is + // considered small enough to be liquidated in a single transaction, bypassing + // dynamic close factor. + string small_liquidation_size = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // stale_price_grace_period determines the grace period before an oracle price + // is regarded as stale. This would cause certain actions like borrowing to be + // paused + google.protobuf.Duration stale_price_grace_period = 8 + [ (gogoproto.stdduration) = true, (gogoproto.nullable) = false ]; + // cdp_paused if true, causes all supply, locking, lending, borrowing and + // liquidations to be paused + bool cdp_paused = 9; + // time interval in between each adjustment of stablecoin interest rate to + // help stablecoin price stability + google.protobuf.Duration stablecoin_interest_rate_epoch = 10 + [ (gogoproto.stdduration) = true, (gogoproto.nullable) = false ]; + // used in formula to calculate stablecoin interest rate to help stablecoin + // price stability + string stablecoin_interest_rate_adjuster_coefficient = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +// ParamsToUpdate allows optional fields for Params. +message ParamsToUpdate { + string interest_fee = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string liquidation_fee = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + reserved 3; // used to be stablecoin_interest_rate, but deprecated + string stablecoin_mint_cap = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string complete_liquidation_threshold = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + string minimum_close_factor = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + string small_liquidation_size = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; + google.protobuf.Duration stale_price_grace_period = 8 + [ (gogoproto.stdduration) = true, (gogoproto.nullable) = true ]; + google.protobuf.BoolValue cdp_paused = 9 [ (gogoproto.wktpointer) = true ]; + google.protobuf.Duration stablecoin_interest_rate_epoch = 10 + [ (gogoproto.stdduration) = true, (gogoproto.nullable) = true ]; + string stablecoin_interest_rate_adjuster_coefficient = 11 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/query.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/query.proto new file mode 100644 index 000000000..f4c85fccb --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/query.proto @@ -0,0 +1,460 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; + +import "Switcheo/carbon/cdp/params.proto"; +import "Switcheo/carbon/cdp/rate_strategy_params.proto"; +import "Switcheo/carbon/cdp/asset_params.proto"; +import "Switcheo/carbon/cdp/debt_info.proto"; +import "Switcheo/carbon/cdp/stablecoin_debt_info.proto"; +import "Switcheo/carbon/cdp/reward_scheme.proto"; +import "Switcheo/carbon/cdp/e_mode_category.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "Switcheo/carbon/cdp/stablecoin_interest_info.proto"; +import "Switcheo/carbon/cdp/cdp_liquidations.proto"; +// this line is used by starport scaffolding # 1 + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; +option (gogoproto.goproto_getters_all) = false; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/carbon/cdp/v1/params"; + } + // Queries a RateStrategy item. + rpc RateStrategy(QueryRateStrategyRequest) + returns (QueryRateStrategyResponse) { + option (google.api.http).get = "/carbon/cdp/v1/rate_strategy/{name}"; + } + + // Queries a list of RateStrategy items. + rpc RateStrategyAll(QueryRateStrategyAllRequest) + returns (QueryRateStrategyAllResponse) { + option (google.api.http).get = "/carbon/cdp/v1/rate_strategy"; + } + + // Queries a AccountData items. + rpc AccountData(QueryAccountDataRequest) returns (QueryAccountDataResponse) { + option (google.api.http).get = "/carbon/cdp/v1/account_data/{address}"; + } + + // Queries a list of AccountCollateral items. + rpc AccountCollateral(QueryAccountCollateralRequest) + returns (QueryAccountCollateralResponse) { + option (google.api.http).get = + "/carbon/cdp/v1/account_collateral/{address}/{cibt_denom}"; + } + + // Queries a list of AccountCollaterals items. + rpc AccountCollateralAll(QueryAccountCollateralAllRequest) + returns (QueryAccountCollateralAllResponse) { + option (google.api.http).get = + "/carbon/cdp/v1/account_collateral/{address}"; + } + + // Queries a list of AccountDebt items. + rpc AccountDebt(QueryAccountDebtRequest) returns (QueryAccountDebtResponse) { + option (google.api.http).get = + "/carbon/cdp/v1/account_debt/{address}/{denom}"; + } + + // Queries a list of AccountDebtAll items. + rpc AccountDebtAll(QueryAccountDebtAllRequest) + returns (QueryAccountDebtAllResponse) { + option (google.api.http).get = "/carbon/cdp/v1/account_debt/{address}"; + } + + // Queries a list of AccountStablecoin items. + rpc AccountStablecoin(QueryAccountStablecoinRequest) + returns (QueryAccountStablecoinResponse) { + option (google.api.http).get = + "/carbon/cdp/v1/account_stablecoin/{address}"; + } + + // Queries a list of Asset items. + rpc Asset(QueryAssetRequest) returns (QueryAssetResponse) { + option (google.api.http).get = "/carbon/cdp/v1/asset/{denom}"; + } + + // Queries a list of AssetsAll items. + rpc AssetAll(QueryAssetAllRequest) returns (QueryAssetAllResponse) { + option (google.api.http).get = "/carbon/cdp/v1/asset"; + } + + // Queries a list of TokenDebt items. + rpc TokenDebt(QueryTokenDebtRequest) returns (QueryTokenDebtResponse) { + option (google.api.http).get = "/carbon/cdp/v1/token_debt/{denom}"; + } + + // Queries a list of TokenDebtsAll items. + rpc TokenDebtAll(QueryTokenDebtAllRequest) + returns (QueryTokenDebtAllResponse) { + option (google.api.http).get = "/carbon/cdp/v1/token_debt"; + } + + // Queries a list of StablecoinDebt items. + rpc StablecoinDebt(QueryStablecoinDebtRequest) + returns (QueryStablecoinDebtResponse) { + option (google.api.http).get = "/carbon/cdp/v1/stablecoin_debt"; + } + + // Queries a list of all RewardSchemes. + rpc RewardSchemesAll(QueryRewardSchemesAllRequest) + returns (QueryRewardSchemesAllResponse) { + option (google.api.http).get = "/carbon/cdp/v1/reward_schemes"; + } + + // Queries a list of RewardDebt items for an address + rpc RewardDebts(QueryRewardDebtsRequest) returns (QueryRewardDebtsResponse) { + option (google.api.http).get = "/carbon/cdp/v1/reward_debts/{address}"; + } + + // Queries a list of all RewardDebts + rpc RewardDebtsAll(QueryRewardDebtsAllRequest) + returns (QueryRewardDebtsResponse) { + option (google.api.http).get = "/carbon/cdp/v1/reward_debts"; + } + + // Queries a list of CDP Positions + rpc PositionsAll(QueryCdpPositionsRequest) + returns (QueryCdpPositionsResponse) { + option (google.api.http).get = "/carbon/cdp/v1/positions"; + } + + rpc Position(QueryCdpPositionRequest) returns (QueryCdpPositionResponse) { + option (google.api.http).get = "/carbon/cdp/v1/positions/{address}"; + } + + rpc HealthFactor(QueryHealthFactorRequest) + returns (QueryHealthFactorResponse) { + option (google.api.http).get = "/carbon/cdp/v1/health_factor/{address}"; + } + + // Queries a list of EMode items. + rpc EMode(QueryEModeRequest) returns (QueryEModeResponse) { + option (google.api.http).get = "/carbon/cdp/v1/e_mode/{name}"; + } + + // Queries a list of EModeAll items. + rpc EModeAll(QueryEModeAllRequest) returns (QueryEModeAllResponse) { + option (google.api.http).get = "/carbon/cdp/v1/e_mode"; + } + + // Queries a list of AccountEMode items. + rpc AccountEMode(QueryAccountEModeRequest) + returns (QueryAccountEModeResponse) { + option (google.api.http).get = "/carbon/cdp/v1/e_mode/address/{address}"; + } + + // Queries StablecoinInterest. + rpc StablecoinInterest(QueryStablecoinInterestRequest) + returns (QueryStablecoinInterestResponse) { + option (google.api.http).get = "/carbon/cdp/v1/stablecoin_interest"; + } + + // Queries a list of CDPLiquidations items. + rpc CDPLiquidationsAll(QueryCDPLiquidationsAllRequest) + returns (QueryCDPLiquidationsAllResponse) { + option (google.api.http).get = "/carbon/cdp/v1/cdp_liquidations"; + } + + // this line is used by starport scaffolding # 2 +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryRateStrategyRequest { string name = 1; } + +message QueryRateStrategyResponse { + RateStrategyParams rate_strategy_params = 1; +} + +message QueryRateStrategyAllRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryRateStrategyAllResponse { + repeated RateStrategyParams rate_strategy_params_all = 1 + [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryAccountDataRequest { string address = 1; } + +message QueryAccountDataResponse { + string total_collaterals_usd = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string total_debts_usd = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string available_borrows_usd = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string curr_liquidation_threshold = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message QueryAccountCollateralRequest { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string cibt_denom = 2; +} + +message QueryAccountCollateralResponse { Collateral collateral = 1; } + +message QueryAccountCollateralAllRequest { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryAccountCollateralAllResponse { + repeated Collateral collaterals = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message Collateral { + string denom = 1; + string cibt_denom = 2; + string collateral_amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message QueryAccountDebtRequest { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string denom = 2; +} + +message QueryAccountDebtResponse { Debt debt = 1; } + +message QueryAccountDebtAllRequest { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryAccountDebtAllResponse { + repeated Debt debts = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message Debt { + string denom = 1; + string principal = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string initial_cumulative_interest_multiplier = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message QueryAccountStablecoinRequest { string address = 1; } + +message QueryAccountStablecoinResponse { + string principal = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string interest = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string initial_cumulative_interest_multiplier = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message QueryAssetRequest { string denom = 1; } + +message QueryAssetResponse { AssetParamsAPI asset_params = 1; } + +message QueryAssetAllRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAssetAllResponse { + repeated AssetParamsAPI asset_params_all = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryTokenDebtRequest { string denom = 1; } + +message QueryTokenDebtResponse { DebtInfo debt_info = 1; } + +message QueryTokenDebtAllRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryTokenDebtAllResponse { + repeated DebtInfo debt_infos_all = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryStablecoinDebtRequest {} + +message QueryStablecoinDebtResponse { + StablecoinDebtInfo stablecoin_debt_info = 1; +} + +message CdpPositionItem { + string address = 1 [ + (gogoproto.moretags) = "db:\"address\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + string denom = 2 [ (gogoproto.moretags) = "db:\"denom\"" ]; + string cibt_denom = 3 [ (gogoproto.moretags) = "db:\"cibt_denom\"" ]; + string health_factor = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"health_factor\"" + ]; + string collateral_amount = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"collateral_amount\"" + ]; + string borrow_amount = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"borrow_amount\"" + ]; + string mint_denom = 7 [ (gogoproto.moretags) = "db:\"mint_denom\"" ]; + string mint_amount = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"mint_amount\"" + ]; +} + +message CdpPosition { + string address = 1 [ + (gogoproto.moretags) = "db:\"address\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + string health_factor = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"health_factor\"" + ]; + repeated cosmos.base.v1beta1.Coin collateral = 3 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin borrow = 4 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin mint = 5 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +message QueryCdpPositionRequest { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +message QueryCdpPositionResponse { CdpPosition position = 1; } + +message QueryCdpPositionsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; + string max_health_factor = 2 [ (gogoproto.nullable) = true ]; + string min_health_factor = 3 [ (gogoproto.nullable) = true ]; +} + +message QueryCdpPositionsResponse { + repeated CdpPosition positions = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryRewardSchemesAllRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryRewardSchemesAllResponse { + repeated RewardScheme reward_schemes = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryRewardDebtsRequest { + string address = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryRewardDebtsResponse { + repeated RewardDebt reward_debts = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryRewardDebtsAllRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryEModeAllRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryEModeAllResponse { + repeated EModeCategory e_mode_categories = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryStablecoinInterestRequest {} + +message QueryStablecoinInterestResponse { + StablecoinInterestInfo stablecoin_interest_info = 1; +} + +message QueryEModeRequest { string name = 1; } + +message QueryEModeResponse { + EModeCategory e_mode_category = 1 [ (gogoproto.nullable) = false ]; +} +message QueryHealthFactorRequest { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} +message QueryHealthFactorResponse { + string health_factor = 1 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message QueryAccountEModeRequest { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +message QueryAccountEModeResponse { string e_mode_category_name = 1; } + +message QueryCDPLiquidationsAllRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryCDPLiquidationsAllResponse { + repeated CDPLiquidations cdp_liquidations_all = 1 + [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// this line is used by starport scaffolding # 3 diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/rate_strategy_params.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/rate_strategy_params.proto new file mode 100644 index 000000000..e537c93fb --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/rate_strategy_params.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "gogoproto/gogo.proto"; +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; +option (gogoproto.goproto_getters_all) = false; + +message RateStrategyParams { + string name = 1; + string optimal_usage = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string base_variable_borrow_rate = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string variable_rate_slope_1 = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string variable_rate_slope_2 = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string base_stable_borrow_rate = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string stable_rate_slope_1 = 7 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string stable_rate_slope_2 = 8 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; + string optimal_stable_to_total_debt_ratio = 9 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/reward_scheme.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/reward_scheme.proto new file mode 100644 index 000000000..801eca288 --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/reward_scheme.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/wrappers.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; + +option (gogoproto.goproto_getters_all) = false; + +message RewardScheme { + uint64 id = 1; + string creator = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string reward_denom = 3; + string asset_denom = 4; + string reward_type = 5; + string reward_amount_per_second = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp start_time = 7 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + google.protobuf.Timestamp end_time = 8 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + google.protobuf.Timestamp reward_per_share_last_updated_at = 9 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + string reward_per_share = 10 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message CreateRewardSchemeParams { + string reward_denom = 1; + string asset_denom = 2; + string reward_type = 3; + string reward_amount_per_second = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp start_time = 5 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + google.protobuf.Timestamp end_time = 6 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; +} + +message UpdateRewardSchemeParams { + uint64 reward_scheme_id = 1; + google.protobuf.StringValue reward_denom = 2 [ (gogoproto.wktpointer) = true + + ]; + google.protobuf.StringValue asset_denom = 3 [ (gogoproto.wktpointer) = true + + ]; + google.protobuf.StringValue reward_type = 4 [ (gogoproto.wktpointer) = true ]; + string reward_amount_per_second = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = true + + ]; + google.protobuf.Timestamp start_time = 6 + [ (gogoproto.stdtime) = true, (gogoproto.wktpointer) = true ]; + google.protobuf.Timestamp end_time = 7 + [ (gogoproto.stdtime) = true, (gogoproto.wktpointer) = true ]; +} + +message RewardDebt { + string user_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + uint64 reward_scheme_id = 2; + string reward_debt = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + google.protobuf.Timestamp last_updated_at = 4 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/stablecoin_debt_info.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/stablecoin_debt_info.proto new file mode 100644 index 000000000..a80e83bd9 --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/stablecoin_debt_info.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; + +message StablecoinDebtInfo { + string denom = 1; + google.protobuf.Timestamp last_updated_time = 2 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + string total_principal = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string cumulative_interest_multiplier = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + string total_accumulated_interest = 5 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/stablecoin_interest_info.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/stablecoin_interest_info.proto new file mode 100644 index 000000000..138cbb04c --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/stablecoin_interest_info.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; + +message StablecoinInterestInfo { + google.protobuf.Timestamp last_updated_time = 1 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + string stablecoin_interest_rate = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/types/protobuf/proto/Switcheo/carbon/cdp/tx.proto b/packages/types/protobuf/proto/Switcheo/carbon/cdp/tx.proto new file mode 100644 index 000000000..6e2cf659e --- /dev/null +++ b/packages/types/protobuf/proto/Switcheo/carbon/cdp/tx.proto @@ -0,0 +1,567 @@ +syntax = "proto3"; +package Switcheo.carbon.cdp; + +import "gogoproto/gogo.proto"; +import "Switcheo/carbon/cdp/rate_strategy_params.proto"; +import "Switcheo/carbon/cdp/e_mode_category.proto"; +import "Switcheo/carbon/cdp/asset_params.proto"; +import "Switcheo/carbon/cdp/reward_scheme.proto"; +import "Switcheo/carbon/cdp/params.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/protobuf/duration.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/Switcheo/carbon/x/cdp/types"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + rpc AddRateStrategy(MsgAddRateStrategy) returns (MsgAddRateStrategyResponse); + rpc RemoveRateStrategy(MsgRemoveRateStrategy) + returns (MsgRemoveRateStrategyResponse); + rpc AddAsset(MsgAddAsset) returns (MsgAddAssetResponse); + rpc UpdateRateStrategy(MsgUpdateRateStrategy) + returns (MsgUpdateRateStrategyResponse); + rpc UpdateAsset(MsgUpdateAsset) returns (MsgUpdateAssetResponse); + rpc SupplyAsset(MsgSupplyAsset) returns (MsgSupplyAssetResponse); + rpc WithdrawAsset(MsgWithdrawAsset) returns (MsgWithdrawAssetResponse); + rpc LockCollateral(MsgLockCollateral) returns (MsgLockCollateralResponse); + rpc UnlockCollateral(MsgUnlockCollateral) + returns (MsgUnlockCollateralResponse); + rpc BorrowAsset(MsgBorrowAsset) returns (MsgBorrowAssetResponse); + rpc RepayAsset(MsgRepayAsset) returns (MsgRepayAssetResponse); + rpc SupplyAssetAndLockCollateral(MsgSupplyAssetAndLockCollateral) + returns (MsgSupplyAssetAndLockCollateralResponse); + rpc UnlockCollateralAndWithdrawAsset(MsgUnlockCollateralAndWithdrawAsset) + returns (MsgUnlockCollateralAndWithdrawAssetResponse); + rpc LiquidateCollateral(MsgLiquidateCollateral) + returns (MsgLiquidateCollateralResponse); + rpc SetLiquidationFee(MsgSetLiquidationFee) + returns (MsgSetLiquidationFeeResponse); + rpc SetInterestFee(MsgSetInterestFee) returns (MsgSetInterestFeeResponse); + rpc CreateRewardScheme(MsgCreateRewardScheme) + returns (MsgCreateRewardSchemeResponse); + rpc UpdateRewardScheme(MsgUpdateRewardScheme) + returns (MsgUpdateRewardSchemeResponse); + rpc ClaimRewards(MsgClaimRewards) returns (MsgClaimRewardsResponse); + rpc SetStablecoinInterestRate(MsgSetStablecoinInterestRate) + returns (MsgSetStablecoinInterestRateResponse); + rpc SetStablecoinMintCap(MsgSetStablecoinMintCap) + returns (MsgSetStablecoinMintCapResponse); + rpc MintStablecoin(MsgMintStablecoin) returns (MsgMintStablecoinResponse); + rpc ReturnStablecoin(MsgReturnStablecoin) + returns (MsgReturnStablecoinResponse); + rpc SetCompleteLiquidationThreshold(MsgSetCompleteLiquidationThreshold) + returns (MsgSetCompleteLiquidationThresholdResponse); + rpc SetMinimumCloseFactor(MsgSetMinimumCloseFactor) + returns (MsgSetMinimumCloseFactorResponse); + rpc SetSmallLiquidationSize(MsgSetSmallLiquidationSize) + returns (MsgSetSmallLiquidationSizeResponse); + rpc SetStalePriceGracePeriod(MsgSetStalePriceGracePeriod) + returns (MsgSetStalePriceGracePeriodResponse); + rpc SetCdpPaused(MsgSetCdpPaused) returns (MsgSetCdpPausedResponse); + rpc ConvertTokenInCdpToGroupTokens(MsgConvertTokenInCdpToGroupTokens) + returns (MsgConvertTokenInCdpToGroupTokensResponse); + rpc AddEModeCategory(MsgAddEModeCategory) + returns (MsgAddEModeCategoryResponse); + rpc UpdateEModeCategory(MsgUpdateEModeCategory) + returns (MsgUpdateEModeCategoryResponse); + rpc SetAccountEMode(MsgSetAccountEMode) returns (MsgSetAccountEModeResponse); + rpc RemoveAccountEMode(MsgRemoveAccountEMode) + returns (MsgRemoveAccountEModeResponse); + // UpdateParams defines a governance operation for updating the module + // parameters. The authority is hard-coded to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // this line is used by starport scaffolding # proto/tx/rpc +} + +message MsgAddRateStrategy { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/AddRateStrategy"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + RateStrategyParams rate_strategy_params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgAddRateStrategyResponse { + RateStrategyParams rate_strategy_params = 1 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateRateStrategy { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/UpdateRateStrategy"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + RateStrategyParams rate_strategy_params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateRateStrategyResponse { + RateStrategyParams rate_strategy_params = 1 [ (gogoproto.nullable) = false ]; +} + +message MsgRemoveRateStrategy { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/RemoveRateStrategy"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string name = 2; +} + +message MsgRemoveRateStrategyResponse { string name = 1; } + +message MsgAddAsset { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/AddAsset"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + AssetParams asset_params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgAddAssetResponse { + AssetParams asset_params = 1 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateAsset { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/UpdateAsset"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + UpdateAssetParams asset_params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateAssetResponse { + AssetParams asset_params = 1 [ (gogoproto.nullable) = false ]; +} + +message MsgSupplyAsset { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SupplyAsset"; + + string creator = 1 [ + (gogoproto.moretags) = "db:\"creator\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + string denom = 2 [ (gogoproto.moretags) = "db:\"denom\"" ]; + string amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"amount\"" + ]; +} + +message MsgSupplyAssetResponse {} + +message MsgWithdrawAsset { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/WithdrawAsset"; + + string creator = 1; + string cibt_denom = 2; + string amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message MsgWithdrawAssetResponse {} + +message MsgLockCollateral { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/LockCollateral"; + + string creator = 1 [ (gogoproto.moretags) = "db:\"creator\"" ]; + string cibt_denom = 2 [ (gogoproto.moretags) = "db:\"denom\"" ]; + string amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"amount\"" + ]; +} + +message MsgLockCollateralResponse {} + +message MsgUnlockCollateral { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/UnlockCollateral"; + + string creator = 1 [ (gogoproto.moretags) = "db:\"creator\"" ]; + string cibt_denom = 2 [ (gogoproto.moretags) = "db:\"denom\"" ]; + string amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"amount\"" + ]; +} + +message MsgUnlockCollateralResponse {} + +message MsgBorrowAsset { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/BorrowAsset"; + + string creator = 1 [ + (gogoproto.moretags) = "db:\"creator\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + string denom = 2 [ (gogoproto.moretags) = "db:\"denom\"" ]; + string amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"amount\"" + ]; +} + +message MsgBorrowAssetResponse {} + +message MsgRepayAsset { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/RepayAsset"; + + string creator = 1 [ + (gogoproto.moretags) = "db:\"creator\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + string denom = 2 [ (gogoproto.moretags) = "db:\"denom\"" ]; + string amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"amount\"" + ]; + string debtor = 4 [ (gogoproto.moretags) = "db:\"debtor\"" ]; + bool from_collateral = 5 [ (gogoproto.moretags) = "db:\"from_collateral\"" ]; +} + +message MsgRepayAssetResponse {} + +message MsgSupplyAssetAndLockCollateral { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SupplyAssetAndLockCollateral"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string denom = 2; + string supply_amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string lock_amount = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message MsgSupplyAssetAndLockCollateralResponse {} + +message MsgUnlockCollateralAndWithdrawAsset { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/UnlockCollateralAndWithdrawAsset"; + + string creator = 1; + string cibt_denom = 2; + string unlock_amount = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + string withdraw_amount = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message MsgUnlockCollateralAndWithdrawAssetResponse {} + +message MsgLiquidateCollateral { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/LiquidateCollateral"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string debtor = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.v1beta1.Coin min_collateral = 3 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + cosmos.base.v1beta1.Coin debt = 4 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + cosmos.base.v1beta1.Coin stable_interest = 5 + [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; + bool debt_from_collateral = 6; + bool interest_from_collateral = 7; +} + +message MsgLiquidateCollateralResponse {} + +message MsgSetLiquidationFee { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SetLiquidationFee"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string liquidation_fee = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message MsgSetLiquidationFeeResponse {} + +message MsgSetInterestFee { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SetInterestFee"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string interest_fee = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message MsgSetInterestFeeResponse {} + +message MsgSetStablecoinMintCap { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SetStablecoinMintCap"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string stablecoin_mint_cap = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message MsgSetStablecoinMintCapResponse {} + +message MsgSetStablecoinInterestRate { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SetStablecoinInterestRate"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string stablecoin_interest_rate = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; +} + +message MsgSetStablecoinInterestRateResponse {} + +message MsgMintStablecoin { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/MintStablecoin"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string amount = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "db:\"amount\"" + ]; +} + +message MsgMintStablecoinResponse {} + +message MsgReturnStablecoin { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/ReturnStablecoin"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.v1beta1.Coin principal = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + cosmos.base.v1beta1.Coin interest = 3 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; + string debtor = 4; + bool principal_from_collateral = 5 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + bool interest_from_collateral = 6; +} + +message MsgReturnStablecoinResponse {} + +message MsgSetCompleteLiquidationThreshold { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SetCompleteLiquidationThreshold"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string complete_liquidation_threshold = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message MsgSetCompleteLiquidationThresholdResponse {} + +message MsgSetMinimumCloseFactor { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SetMinimumCloseFactor"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string minimum_close_factor = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message MsgSetMinimumCloseFactorResponse {} + +message MsgSetSmallLiquidationSize { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SetSmallLiquidationSize"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string small_liquidation_size = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} + +message MsgSetSmallLiquidationSizeResponse {} + +message MsgCreateRewardScheme { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/CreateRewardScheme"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + CreateRewardSchemeParams create_reward_scheme_params = 2 + [ (gogoproto.nullable) = false ]; +} + +message MsgCreateRewardSchemeResponse {} + +message MsgUpdateRewardScheme { + option (cosmos.msg.v1.signer) = "updater"; + option (amino.name) = "cdp/UpdateRewardScheme"; + + string updater = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + UpdateRewardSchemeParams update_reward_scheme_params = 2 + [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateRewardSchemeResponse {} + +message MsgClaimRewards { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/ClaimRewards"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +message MsgClaimRewardsResponse {} + +message MsgSetStalePriceGracePeriod { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SetStalePriceGracePeriod"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + google.protobuf.Duration stale_price_grace_period = 2 + [ (gogoproto.stdduration) = true, (gogoproto.nullable) = false ]; +} + +message MsgSetStalePriceGracePeriodResponse {} + +message MsgSetCdpPaused { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SetCdpPaused"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + bool cdpPaused = 2; +} + +message MsgSetCdpPausedResponse {} + +message MsgConvertTokenInCdpToGroupTokens { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/ConvertTokenInCdpToGroupTokens"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string denom = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +message MsgConvertTokenInCdpToGroupTokensResponse {} + +message MsgAddEModeCategory { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/AddEModeCategory"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + EModeCategory e_mode_category = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgAddEModeCategoryResponse {} + +message MsgUpdateEModeCategory { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/UpdateEModeCategory"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string e_mode_category_name = 2; + UpdateEModeCategoryParams update_e_mode_category_params = 3 + [ (gogoproto.nullable) = false ]; +} + +message UpdateEModeCategoryParams { + repeated google.protobuf.StringValue denoms = 1 + [ (gogoproto.wktpointer) = true ]; + google.protobuf.Int64Value loan_to_value = 2 + [ (gogoproto.wktpointer) = true ]; + google.protobuf.Int64Value liquidation_threshold = 3 + [ (gogoproto.wktpointer) = true ]; + google.protobuf.Int64Value liquidation_discount = 4 + [ (gogoproto.wktpointer) = true ]; + google.protobuf.BoolValue is_active = 6 [ + (gogoproto.moretags) = "db:\"is_active\"", + (gogoproto.wktpointer) = true + ]; +} + +message MsgUpdateEModeCategoryResponse {} + +message MsgSetAccountEMode { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/SetAccountEMode"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string e_mode_category_name = 2; +} + +message MsgSetAccountEModeResponse {} + +message MsgRemoveAccountEMode { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "cdp/RemoveAccountEMode"; + + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +message MsgRemoveAccountEModeResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cdp/MsgUpdateParams"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // params defines the optional parameters to update. + ParamsToUpdate params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// this line is used by starport scaffolding # proto/tx/message diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index 7113d40d2..769aedc6a 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -128,6 +128,7 @@ telescope({ 'OmniFlix.onft.v1beta1', 'interchain_security.ccv.consumer.v1', 'interchain_security.ccv.provider.v1', + 'Switcheo.carbon.cdp', // interferes with v1beta1 MsgSubmitProposal amino encoders since the // type names overlap diff --git a/packages/types/protobuf/utils.ts b/packages/types/protobuf/utils.ts index c9b11450a..562017493 100644 --- a/packages/types/protobuf/utils.ts +++ b/packages/types/protobuf/utils.ts @@ -53,6 +53,8 @@ import { secretProtoRegistry, publicawesomeAminoConverters as stargazeAminoConverters, publicawesomeProtoRegistry as stargazeProtoRegistry, + switcheoAminoConverters, + switcheoProtoRegistry, } from './codegen' import { MsgCreateAllianceProposal, @@ -697,6 +699,7 @@ export const getProtobufTypes = (): ReadonlyArray<[string, GeneratedType]> => [ ...secretProtoRegistry, ...omniFlixProtoRegistry, ...interchainSecurityProtoRegistry, + ...switcheoProtoRegistry, // Not a query or TX so it isn't included in any of the registries. But we // want to decode this because it appears in gov props. We need to find a // better way to collect all generated types in a single registry... @@ -742,7 +745,7 @@ export const getAminoTypes = () => ...secretAminoConverters, ...omniFlixAminoConverters, ...interchainSecurityAminoConverters, - + ...switcheoAminoConverters, // gaia.metaprotocols [ExtensionData.typeUrl]: { // the Amino type is the same as the protobuf type URL, deviating from