//@ts-nocheck
import { Params, ParamsAmino, ParamsSDKType } from "./types";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { isSet } from "../../../helpers";
import { JsonSafe } from "../../../json-safe";
import { GlobalDecoderRegistry } from "../../../registry";
export interface MsgUpdateParams {
authority: string;
params: Params;
}
export interface MsgUpdateParamsProtoMsg {
typeUrl: "/cyber.bandwidth.v1beta1.MsgUpdateParams";
value: Uint8Array;
}
export interface MsgUpdateParamsAmino {
authority?: string;
params?: ParamsAmino;
}
export interface MsgUpdateParamsAminoMsg {
type: "/cyber.bandwidth.v1beta1.MsgUpdateParams";
value: MsgUpdateParamsAmino;
}
export interface MsgUpdateParamsSDKType {
authority: string;
params: ParamsSDKType;
}
export interface MsgUpdateParamsResponse {}
export interface MsgUpdateParamsResponseProtoMsg {
typeUrl: "/cyber.bandwidth.v1beta1.MsgUpdateParamsResponse";
value: Uint8Array;
}
export interface MsgUpdateParamsResponseAmino {}
export interface MsgUpdateParamsResponseAminoMsg {
type: "/cyber.bandwidth.v1beta1.MsgUpdateParamsResponse";
value: MsgUpdateParamsResponseAmino;
}
export interface MsgUpdateParamsResponseSDKType {}
function createBaseMsgUpdateParams(): MsgUpdateParams {
return {
authority: "",
params: Params.fromPartial({})
};
}
export const MsgUpdateParams = {
typeUrl: "/cyber.bandwidth.v1beta1.MsgUpdateParams",
is(o: any): o is MsgUpdateParams {
return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params));
},
isSDK(o: any): o is MsgUpdateParamsSDKType {
return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isSDK(o.params));
},
isAmino(o: any): o is MsgUpdateParamsAmino {
return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params));
},
encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}
if (message.params !== undefined) {
Params.encode(message.params, writer.uint32(18).fork()).ldelim();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): 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 = Params.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): MsgUpdateParams {
return {
authority: isSet(object.authority) ? String(object.authority) : "",
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined
};
},
toJSON(message: MsgUpdateParams): JsonSafe<MsgUpdateParams> {
const obj: any = {};
message.authority !== undefined && (obj.authority = message.authority);
message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined);
return obj;
},
fromPartial(object: Partial<MsgUpdateParams>): MsgUpdateParams {
const message = createBaseMsgUpdateParams();
message.authority = object.authority ?? "";
message.params = object.params !== undefined && object.params !== null ? Params.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 = Params.fromAmino(object.params);
}
return message;
},
toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino {
const obj: any = {};
obj.authority = message.authority === "" ? undefined : message.authority;
obj.params = message.params ? Params.toAmino(message.params) : undefined;
return obj;
},
fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams {
return MsgUpdateParams.fromAmino(object.value);
},
fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams {
return MsgUpdateParams.decode(message.value);
},
toProto(message: MsgUpdateParams): Uint8Array {
return MsgUpdateParams.encode(message).finish();
},
toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg {
return {
typeUrl: "/cyber.bandwidth.v1beta1.MsgUpdateParams",
value: MsgUpdateParams.encode(message).finish()
};
}
};
GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams);
function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse {
return {};
}
export const MsgUpdateParamsResponse = {
typeUrl: "/cyber.bandwidth.v1beta1.MsgUpdateParamsResponse",
is(o: any): o is MsgUpdateParamsResponse {
return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl;
},
isSDK(o: any): o is MsgUpdateParamsResponseSDKType {
return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl;
},
isAmino(o: any): o is MsgUpdateParamsResponseAmino {
return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl;
},
encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): 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;
},
fromJSON(_: any): MsgUpdateParamsResponse {
return {};
},
toJSON(_: MsgUpdateParamsResponse): JsonSafe<MsgUpdateParamsResponse> {
const obj: any = {};
return obj;
},
fromPartial(_: Partial<MsgUpdateParamsResponse>): MsgUpdateParamsResponse {
const message = createBaseMsgUpdateParamsResponse();
return message;
},
fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse {
const message = createBaseMsgUpdateParamsResponse();
return message;
},
toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino {
const obj: any = {};
return obj;
},
fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse {
return MsgUpdateParamsResponse.fromAmino(object.value);
},
fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse {
return MsgUpdateParamsResponse.decode(message.value);
},
toProto(message: MsgUpdateParamsResponse): Uint8Array {
return MsgUpdateParamsResponse.encode(message).finish();
},
toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg {
return {
typeUrl: "/cyber.bandwidth.v1beta1.MsgUpdateParamsResponse",
value: MsgUpdateParamsResponse.encode(message).finish()
};
}
};
GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse);