UNPKG

interchainjs

Version:

InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.

1,246 lines (1,245 loc) 126 kB
import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; import { Channel, IdentifiedChannel, PacketState } from "./channel"; import { Height, IdentifiedClientState } from "../../client/v1/client"; import { Any } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { GlobalDecoderRegistry } from "../../../../registry"; function createBaseQueryChannelRequest() { return { portId: "", channelId: "" }; } /** * QueryChannelRequest is the request type for the Query/Channel RPC method * @name QueryChannelRequest * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryChannelRequest */ export const QueryChannelRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelRequest", aminoType: "cosmos-sdk/QueryChannelRequest", is(o) { return o && (o.$typeUrl === QueryChannelRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); }, isAmino(o) { return o && (o.$typeUrl === QueryChannelRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); }, encode(message, writer = BinaryWriter.create()) { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.portId = reader.string(); break; case 2: message.channelId = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryChannelRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; return message; }, fromAmino(object) { const message = createBaseQueryChannelRequest(); if (object.port_id !== undefined && object.port_id !== null) { message.portId = object.port_id; } if (object.channel_id !== undefined && object.channel_id !== null) { message.channelId = object.channel_id; } return message; }, toAmino(message) { const obj = {}; obj.port_id = message.portId === "" ? undefined : message.portId; obj.channel_id = message.channelId === "" ? undefined : message.channelId; return obj; }, fromAminoMsg(object) { return QueryChannelRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelRequest", value: QueryChannelRequest.toAmino(message) }; }, fromProtoMsg(message) { return QueryChannelRequest.decode(message.value); }, toProto(message) { return QueryChannelRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelRequest", value: QueryChannelRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseQueryChannelResponse() { return { channel: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; } /** * QueryChannelResponse is the response type for the Query/Channel RPC method. * Besides the Channel end, it includes a proof and the height from which the * proof was retrieved. * @name QueryChannelResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryChannelResponse */ export const QueryChannelResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelResponse", aminoType: "cosmos-sdk/QueryChannelResponse", is(o) { return o && (o.$typeUrl === QueryChannelResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); }, isAmino(o) { return o && (o.$typeUrl === QueryChannelResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); }, encode(message, writer = BinaryWriter.create()) { if (message.channel !== undefined) { Channel.encode(message.channel, writer.uint32(10).fork()).ldelim(); } if (message.proof.length !== 0) { writer.uint32(18).bytes(message.proof); } if (message.proofHeight !== undefined) { Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.channel = Channel.decode(reader, reader.uint32()); break; case 2: message.proof = reader.bytes(); break; case 3: message.proofHeight = Height.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryChannelResponse(); message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; message.proof = object.proof ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryChannelResponse(); if (object.channel !== undefined && object.channel !== null) { message.channel = Channel.fromAmino(object.channel); } if (object.proof !== undefined && object.proof !== null) { message.proof = bytesFromBase64(object.proof); } if (object.proof_height !== undefined && object.proof_height !== null) { message.proofHeight = Height.fromAmino(object.proof_height); } return message; }, toAmino(message) { const obj = {}; obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, fromAminoMsg(object) { return QueryChannelResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelResponse", value: QueryChannelResponse.toAmino(message) }; }, fromProtoMsg(message) { return QueryChannelResponse.decode(message.value); }, toProto(message) { return QueryChannelResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelResponse", value: QueryChannelResponse.encode(message).finish() }; }, registerTypeUrl() { if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryChannelResponse.typeUrl)) { return; } Channel.registerTypeUrl(); Height.registerTypeUrl(); } }; function createBaseQueryChannelsRequest() { return { pagination: undefined }; } /** * QueryChannelsRequest is the request type for the Query/Channels RPC method * @name QueryChannelsRequest * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryChannelsRequest */ export const QueryChannelsRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest", aminoType: "cosmos-sdk/QueryChannelsRequest", is(o) { return o && o.$typeUrl === QueryChannelsRequest.typeUrl; }, isAmino(o) { return o && o.$typeUrl === QueryChannelsRequest.typeUrl; }, encode(message, writer = BinaryWriter.create()) { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.pagination = PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryChannelsRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryChannelsRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return QueryChannelsRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelsRequest", value: QueryChannelsRequest.toAmino(message) }; }, fromProtoMsg(message) { return QueryChannelsRequest.decode(message.value); }, toProto(message) { return QueryChannelsRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest", value: QueryChannelsRequest.encode(message).finish() }; }, registerTypeUrl() { if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryChannelsRequest.typeUrl)) { return; } PageRequest.registerTypeUrl(); } }; function createBaseQueryChannelsResponse() { return { channels: [], pagination: undefined, height: Height.fromPartial({}) }; } /** * QueryChannelsResponse is the response type for the Query/Channels RPC method. * @name QueryChannelsResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryChannelsResponse */ export const QueryChannelsResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelsResponse", aminoType: "cosmos-sdk/QueryChannelsResponse", is(o) { return o && (o.$typeUrl === QueryChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.is(o.channels[0])) && Height.is(o.height)); }, isAmino(o) { return o && (o.$typeUrl === QueryChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.isAmino(o.channels[0])) && Height.isAmino(o.height)); }, encode(message, writer = BinaryWriter.create()) { for (const v of message.channels) { IdentifiedChannel.encode(v, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } if (message.height !== undefined) { Height.encode(message.height, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); break; case 3: message.height = Height.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryChannelsResponse(); message.channels = object.channels?.map(e => IdentifiedChannel.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryChannelsResponse(); message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageResponse.fromAmino(object.pagination); } if (object.height !== undefined && object.height !== null) { message.height = Height.fromAmino(object.height); } return message; }, toAmino(message) { const obj = {}; if (message.channels) { obj.channels = message.channels.map(e => e ? IdentifiedChannel.toAmino(e) : undefined); } else { obj.channels = message.channels; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; obj.height = message.height ? Height.toAmino(message.height) : {}; return obj; }, fromAminoMsg(object) { return QueryChannelsResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelsResponse", value: QueryChannelsResponse.toAmino(message) }; }, fromProtoMsg(message) { return QueryChannelsResponse.decode(message.value); }, toProto(message) { return QueryChannelsResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelsResponse", value: QueryChannelsResponse.encode(message).finish() }; }, registerTypeUrl() { if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryChannelsResponse.typeUrl)) { return; } IdentifiedChannel.registerTypeUrl(); PageResponse.registerTypeUrl(); Height.registerTypeUrl(); } }; function createBaseQueryConnectionChannelsRequest() { return { connection: "", pagination: undefined }; } /** * QueryConnectionChannelsRequest is the request type for the * Query/QueryConnectionChannels RPC method * @name QueryConnectionChannelsRequest * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryConnectionChannelsRequest */ export const QueryConnectionChannelsRequest = { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest", aminoType: "cosmos-sdk/QueryConnectionChannelsRequest", is(o) { return o && (o.$typeUrl === QueryConnectionChannelsRequest.typeUrl || typeof o.connection === "string"); }, isAmino(o) { return o && (o.$typeUrl === QueryConnectionChannelsRequest.typeUrl || typeof o.connection === "string"); }, encode(message, writer = BinaryWriter.create()) { if (message.connection !== "") { writer.uint32(10).string(message.connection); } if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionChannelsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.connection = reader.string(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryConnectionChannelsRequest(); message.connection = object.connection ?? ""; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryConnectionChannelsRequest(); if (object.connection !== undefined && object.connection !== null) { message.connection = object.connection; } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.connection = message.connection === "" ? undefined : message.connection; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return QueryConnectionChannelsRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryConnectionChannelsRequest", value: QueryConnectionChannelsRequest.toAmino(message) }; }, fromProtoMsg(message) { return QueryConnectionChannelsRequest.decode(message.value); }, toProto(message) { return QueryConnectionChannelsRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest", value: QueryConnectionChannelsRequest.encode(message).finish() }; }, registerTypeUrl() { if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryConnectionChannelsRequest.typeUrl)) { return; } PageRequest.registerTypeUrl(); } }; function createBaseQueryConnectionChannelsResponse() { return { channels: [], pagination: undefined, height: Height.fromPartial({}) }; } /** * QueryConnectionChannelsResponse is the Response type for the * Query/QueryConnectionChannels RPC method * @name QueryConnectionChannelsResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryConnectionChannelsResponse */ export const QueryConnectionChannelsResponse = { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsResponse", aminoType: "cosmos-sdk/QueryConnectionChannelsResponse", is(o) { return o && (o.$typeUrl === QueryConnectionChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.is(o.channels[0])) && Height.is(o.height)); }, isAmino(o) { return o && (o.$typeUrl === QueryConnectionChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.isAmino(o.channels[0])) && Height.isAmino(o.height)); }, encode(message, writer = BinaryWriter.create()) { for (const v of message.channels) { IdentifiedChannel.encode(v, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } if (message.height !== undefined) { Height.encode(message.height, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionChannelsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); break; case 3: message.height = Height.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryConnectionChannelsResponse(); message.channels = object.channels?.map(e => IdentifiedChannel.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryConnectionChannelsResponse(); message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageResponse.fromAmino(object.pagination); } if (object.height !== undefined && object.height !== null) { message.height = Height.fromAmino(object.height); } return message; }, toAmino(message) { const obj = {}; if (message.channels) { obj.channels = message.channels.map(e => e ? IdentifiedChannel.toAmino(e) : undefined); } else { obj.channels = message.channels; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; obj.height = message.height ? Height.toAmino(message.height) : {}; return obj; }, fromAminoMsg(object) { return QueryConnectionChannelsResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryConnectionChannelsResponse", value: QueryConnectionChannelsResponse.toAmino(message) }; }, fromProtoMsg(message) { return QueryConnectionChannelsResponse.decode(message.value); }, toProto(message) { return QueryConnectionChannelsResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsResponse", value: QueryConnectionChannelsResponse.encode(message).finish() }; }, registerTypeUrl() { if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryConnectionChannelsResponse.typeUrl)) { return; } IdentifiedChannel.registerTypeUrl(); PageResponse.registerTypeUrl(); Height.registerTypeUrl(); } }; function createBaseQueryChannelClientStateRequest() { return { portId: "", channelId: "" }; } /** * QueryChannelClientStateRequest is the request type for the Query/ClientState * RPC method * @name QueryChannelClientStateRequest * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryChannelClientStateRequest */ export const QueryChannelClientStateRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateRequest", aminoType: "cosmos-sdk/QueryChannelClientStateRequest", is(o) { return o && (o.$typeUrl === QueryChannelClientStateRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); }, isAmino(o) { return o && (o.$typeUrl === QueryChannelClientStateRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); }, encode(message, writer = BinaryWriter.create()) { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelClientStateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.portId = reader.string(); break; case 2: message.channelId = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryChannelClientStateRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; return message; }, fromAmino(object) { const message = createBaseQueryChannelClientStateRequest(); if (object.port_id !== undefined && object.port_id !== null) { message.portId = object.port_id; } if (object.channel_id !== undefined && object.channel_id !== null) { message.channelId = object.channel_id; } return message; }, toAmino(message) { const obj = {}; obj.port_id = message.portId === "" ? undefined : message.portId; obj.channel_id = message.channelId === "" ? undefined : message.channelId; return obj; }, fromAminoMsg(object) { return QueryChannelClientStateRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelClientStateRequest", value: QueryChannelClientStateRequest.toAmino(message) }; }, fromProtoMsg(message) { return QueryChannelClientStateRequest.decode(message.value); }, toProto(message) { return QueryChannelClientStateRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateRequest", value: QueryChannelClientStateRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseQueryChannelClientStateResponse() { return { identifiedClientState: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; } /** * QueryChannelClientStateResponse is the Response type for the * Query/QueryChannelClientState RPC method * @name QueryChannelClientStateResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryChannelClientStateResponse */ export const QueryChannelClientStateResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateResponse", aminoType: "cosmos-sdk/QueryChannelClientStateResponse", is(o) { return o && (o.$typeUrl === QueryChannelClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); }, isAmino(o) { return o && (o.$typeUrl === QueryChannelClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); }, encode(message, writer = BinaryWriter.create()) { if (message.identifiedClientState !== undefined) { IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); } if (message.proof.length !== 0) { writer.uint32(18).bytes(message.proof); } if (message.proofHeight !== undefined) { Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelClientStateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32()); break; case 2: message.proof = reader.bytes(); break; case 3: message.proofHeight = Height.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryChannelClientStateResponse(); message.identifiedClientState = object.identifiedClientState !== undefined && object.identifiedClientState !== null ? IdentifiedClientState.fromPartial(object.identifiedClientState) : undefined; message.proof = object.proof ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryChannelClientStateResponse(); if (object.identified_client_state !== undefined && object.identified_client_state !== null) { message.identifiedClientState = IdentifiedClientState.fromAmino(object.identified_client_state); } if (object.proof !== undefined && object.proof !== null) { message.proof = bytesFromBase64(object.proof); } if (object.proof_height !== undefined && object.proof_height !== null) { message.proofHeight = Height.fromAmino(object.proof_height); } return message; }, toAmino(message) { const obj = {}; obj.identified_client_state = message.identifiedClientState ? IdentifiedClientState.toAmino(message.identifiedClientState) : undefined; obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, fromAminoMsg(object) { return QueryChannelClientStateResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelClientStateResponse", value: QueryChannelClientStateResponse.toAmino(message) }; }, fromProtoMsg(message) { return QueryChannelClientStateResponse.decode(message.value); }, toProto(message) { return QueryChannelClientStateResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateResponse", value: QueryChannelClientStateResponse.encode(message).finish() }; }, registerTypeUrl() { if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryChannelClientStateResponse.typeUrl)) { return; } IdentifiedClientState.registerTypeUrl(); Height.registerTypeUrl(); } }; function createBaseQueryChannelConsensusStateRequest() { return { portId: "", channelId: "", revisionNumber: BigInt(0), revisionHeight: BigInt(0) }; } /** * QueryChannelConsensusStateRequest is the request type for the * Query/ConsensusState RPC method * @name QueryChannelConsensusStateRequest * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryChannelConsensusStateRequest */ export const QueryChannelConsensusStateRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateRequest", aminoType: "cosmos-sdk/QueryChannelConsensusStateRequest", is(o) { return o && (o.$typeUrl === QueryChannelConsensusStateRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.revisionNumber === "bigint" && typeof o.revisionHeight === "bigint"); }, isAmino(o) { return o && (o.$typeUrl === QueryChannelConsensusStateRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint"); }, encode(message, writer = BinaryWriter.create()) { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } if (message.revisionNumber !== BigInt(0)) { writer.uint32(24).uint64(message.revisionNumber); } if (message.revisionHeight !== BigInt(0)) { writer.uint32(32).uint64(message.revisionHeight); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelConsensusStateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.portId = reader.string(); break; case 2: message.channelId = reader.string(); break; case 3: message.revisionNumber = reader.uint64(); break; case 4: message.revisionHeight = reader.uint64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryChannelConsensusStateRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); return message; }, fromAmino(object) { const message = createBaseQueryChannelConsensusStateRequest(); if (object.port_id !== undefined && object.port_id !== null) { message.portId = object.port_id; } if (object.channel_id !== undefined && object.channel_id !== null) { message.channelId = object.channel_id; } if (object.revision_number !== undefined && object.revision_number !== null) { message.revisionNumber = BigInt(object.revision_number); } if (object.revision_height !== undefined && object.revision_height !== null) { message.revisionHeight = BigInt(object.revision_height); } return message; }, toAmino(message) { const obj = {}; obj.port_id = message.portId === "" ? undefined : message.portId; obj.channel_id = message.channelId === "" ? undefined : message.channelId; obj.revision_number = message.revisionNumber !== BigInt(0) ? message.revisionNumber?.toString() : undefined; obj.revision_height = message.revisionHeight !== BigInt(0) ? message.revisionHeight?.toString() : undefined; return obj; }, fromAminoMsg(object) { return QueryChannelConsensusStateRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelConsensusStateRequest", value: QueryChannelConsensusStateRequest.toAmino(message) }; }, fromProtoMsg(message) { return QueryChannelConsensusStateRequest.decode(message.value); }, toProto(message) { return QueryChannelConsensusStateRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateRequest", value: QueryChannelConsensusStateRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseQueryChannelConsensusStateResponse() { return { consensusState: undefined, clientId: "", proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; } /** * QueryChannelClientStateResponse is the Response type for the * Query/QueryChannelClientState RPC method * @name QueryChannelConsensusStateResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryChannelConsensusStateResponse */ export const QueryChannelConsensusStateResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateResponse", aminoType: "cosmos-sdk/QueryChannelConsensusStateResponse", is(o) { return o && (o.$typeUrl === QueryChannelConsensusStateResponse.typeUrl || typeof o.clientId === "string" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); }, isAmino(o) { return o && (o.$typeUrl === QueryChannelConsensusStateResponse.typeUrl || typeof o.client_id === "string" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); }, encode(message, writer = BinaryWriter.create()) { if (message.consensusState !== undefined) { Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); } if (message.clientId !== "") { writer.uint32(18).string(message.clientId); } if (message.proof.length !== 0) { writer.uint32(26).bytes(message.proof); } if (message.proofHeight !== undefined) { Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelConsensusStateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.consensusState = Any.decode(reader, reader.uint32()); break; case 2: message.clientId = reader.string(); break; case 3: message.proof = reader.bytes(); break; case 4: message.proofHeight = Height.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryChannelConsensusStateResponse(); message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; message.clientId = object.clientId ?? ""; message.proof = object.proof ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryChannelConsensusStateResponse(); if (object.consensus_state !== undefined && object.consensus_state !== null) { message.consensusState = Any.fromAmino(object.consensus_state); } if (object.client_id !== undefined && object.client_id !== null) { message.clientId = object.client_id; } if (object.proof !== undefined && object.proof !== null) { message.proof = bytesFromBase64(object.proof); } if (object.proof_height !== undefined && object.proof_height !== null) { message.proofHeight = Height.fromAmino(object.proof_height); } return message; }, toAmino(message) { const obj = {}; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; obj.client_id = message.clientId === "" ? undefined : message.clientId; obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, fromAminoMsg(object) { return QueryChannelConsensusStateResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelConsensusStateResponse", value: QueryChannelConsensusStateResponse.toAmino(message) }; }, fromProtoMsg(message) { return QueryChannelConsensusStateResponse.decode(message.value); }, toProto(message) { return QueryChannelConsensusStateResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateResponse", value: QueryChannelConsensusStateResponse.encode(message).finish() }; }, registerTypeUrl() { if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryChannelConsensusStateResponse.typeUrl)) { return; } Height.registerTypeUrl(); } }; function createBaseQueryPacketCommitmentRequest() { return { portId: "", channelId: "", sequence: BigInt(0) }; } /** * QueryPacketCommitmentRequest is the request type for the * Query/PacketCommitment RPC method * @name QueryPacketCommitmentRequest * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryPacketCommitmentRequest */ export const QueryPacketCommitmentRequest = { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentRequest", aminoType: "cosmos-sdk/QueryPacketCommitmentRequest", is(o) { return o && (o.$typeUrl === QueryPacketCommitmentRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint"); }, isAmino(o) { return o && (o.$typeUrl === QueryPacketCommitmentRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); }, encode(message, writer = BinaryWriter.create()) { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketCommitmentRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.portId = reader.string(); break; case 2: message.channelId = reader.string(); break; case 3: message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryPacketCommitmentRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); return message; }, fromAmino(object) { const message = createBaseQueryPacketCommitmentRequest(); if (object.port_id !== undefined && object.port_id !== null) { message.portId = object.port_id; } if (object.channel_id !== undefined && object.channel_id !== null) { message.channelId = object.channel_id; } if (object.sequence !== undefined && object.sequence !== null) { message.sequence = BigInt(object.sequence); } return message; }, toAmino(message) { const obj = {}; obj.port_id = message.portId === "" ? undefined : message.portId; obj.channel_id = message.channelId === "" ? undefined : message.channelId; obj.sequence = message.sequence !== BigInt(0) ? message.sequence?.toString() : undefined; return obj; }, fromAminoMsg(object) { return QueryPacketCommitmentRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryPacketCommitmentRequest", value: QueryPacketCommitmentRequest.toAmino(message) }; }, fromProtoMsg(message) { return QueryPacketCommitmentRequest.decode(message.value); }, toProto(message) { return QueryPacketCommitmentRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentRequest", value: QueryPacketCommitmentRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseQueryPacketCommitmentResponse() { return { commitment: new Uint8Array(), proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; } /** * QueryPacketCommitmentResponse defines the client query response for a packet * which also includes a proof and the height from which the proof was * retrieved * @name QueryPacketCommitmentResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.QueryPacketCommitmentResponse */ export const QueryPacketCommitmentResponse = { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentResponse", aminoType: "cosmos-sdk/QueryPacketCommitmentResponse", is(o) { return o && (o.$typeUrl === QueryPacketCommitmentResponse.typeUrl || (o.commitment instanceof Uint8Array || typeof o.commitment === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); }, isAmino(o) { return o && (o.$typeUrl === QueryPacketCommitmentResponse.typeUrl || (o.commitment instanceof Uint8Array || typeof o.commitment === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); }, encode(message, writer = BinaryWriter.create()) { if (message.commitment.length !== 0) { writer.uint32(10).bytes(message.commitment); } if (message.proof.length !== 0) { writer.uint32(18).bytes(message.proof); } if (message.proofHeight !== undefined) { Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketCommitmentResponse(); while (reader.pos < end) {