UNPKG

@bandprotocol/bandchain.js

Version:

TypeScript library for Cosmos SDK and BandChain

1,216 lines 98.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QueryNextSequenceReceiveResponse = exports.QueryNextSequenceReceiveRequest = exports.QueryUnreceivedAcksResponse = exports.QueryUnreceivedAcksRequest = exports.QueryUnreceivedPacketsResponse = exports.QueryUnreceivedPacketsRequest = exports.QueryPacketAcknowledgementsResponse = exports.QueryPacketAcknowledgementsRequest = exports.QueryPacketAcknowledgementResponse = exports.QueryPacketAcknowledgementRequest = exports.QueryPacketReceiptResponse = exports.QueryPacketReceiptRequest = exports.QueryPacketCommitmentsResponse = exports.QueryPacketCommitmentsRequest = exports.QueryPacketCommitmentResponse = exports.QueryPacketCommitmentRequest = exports.QueryChannelConsensusStateResponse = exports.QueryChannelConsensusStateRequest = exports.QueryChannelClientStateResponse = exports.QueryChannelClientStateRequest = exports.QueryConnectionChannelsResponse = exports.QueryConnectionChannelsRequest = exports.QueryChannelsResponse = exports.QueryChannelsRequest = exports.QueryChannelResponse = exports.QueryChannelRequest = void 0; //@ts-nocheck const pagination_1 = require("../../../../cosmos/base/query/v1beta1/pagination"); const channel_1 = require("./channel"); const client_1 = require("../../client/v1/client"); const any_1 = require("../../../../google/protobuf/any"); const binary_1 = require("../../../../binary"); const helpers_1 = require("../../../../helpers"); function createBaseQueryChannelRequest() { return { portId: "", channelId: "" }; } exports.QueryChannelRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelRequest", encode(message, writer = binary_1.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 binary_1.BinaryReader ? input : new binary_1.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 exports.QueryChannelRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelRequest", value: exports.QueryChannelRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryChannelRequest.decode(message.value); }, toProto(message) { return exports.QueryChannelRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelRequest", value: exports.QueryChannelRequest.encode(message).finish() }; } }; function createBaseQueryChannelResponse() { return { channel: undefined, proof: new Uint8Array(), proofHeight: client_1.Height.fromPartial({}) }; } exports.QueryChannelResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelResponse", encode(message, writer = binary_1.BinaryWriter.create()) { if (message.channel !== undefined) { channel_1.Channel.encode(message.channel, writer.uint32(10).fork()).ldelim(); } if (message.proof.length !== 0) { writer.uint32(18).bytes(message.proof); } if (message.proofHeight !== undefined) { client_1.Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.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_1.Channel.decode(reader, reader.uint32()); break; case 2: message.proof = reader.bytes(); break; case 3: message.proofHeight = client_1.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_1.Channel.fromPartial(object.channel) : undefined; message.proof = object.proof ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? client_1.Height.fromPartial(object.proofHeight) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryChannelResponse(); if (object.channel !== undefined && object.channel !== null) { message.channel = channel_1.Channel.fromAmino(object.channel); } if (object.proof !== undefined && object.proof !== null) { message.proof = (0, helpers_1.bytesFromBase64)(object.proof); } if (object.proof_height !== undefined && object.proof_height !== null) { message.proofHeight = client_1.Height.fromAmino(object.proof_height); } return message; }, toAmino(message) { const obj = {}; obj.channel = message.channel ? channel_1.Channel.toAmino(message.channel) : undefined; obj.proof = message.proof ? (0, helpers_1.base64FromBytes)(message.proof) : undefined; obj.proof_height = message.proofHeight ? client_1.Height.toAmino(message.proofHeight) : {}; return obj; }, fromAminoMsg(object) { return exports.QueryChannelResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelResponse", value: exports.QueryChannelResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryChannelResponse.decode(message.value); }, toProto(message) { return exports.QueryChannelResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelResponse", value: exports.QueryChannelResponse.encode(message).finish() }; } }; function createBaseQueryChannelsRequest() { return { pagination: undefined }; } exports.QueryChannelsRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest", encode(message, writer = binary_1.BinaryWriter.create()) { if (message.pagination !== undefined) { pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.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 = pagination_1.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 ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryChannelsRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageRequest.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.QueryChannelsRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelsRequest", value: exports.QueryChannelsRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryChannelsRequest.decode(message.value); }, toProto(message) { return exports.QueryChannelsRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest", value: exports.QueryChannelsRequest.encode(message).finish() }; } }; function createBaseQueryChannelsResponse() { return { channels: [], pagination: undefined, height: client_1.Height.fromPartial({}) }; } exports.QueryChannelsResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelsResponse", encode(message, writer = binary_1.BinaryWriter.create()) { for (const v of message.channels) { channel_1.IdentifiedChannel.encode(v, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } if (message.height !== undefined) { client_1.Height.encode(message.height, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.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(channel_1.IdentifiedChannel.decode(reader, reader.uint32())); break; case 2: message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); break; case 3: message.height = client_1.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 => channel_1.IdentifiedChannel.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; message.height = object.height !== undefined && object.height !== null ? client_1.Height.fromPartial(object.height) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryChannelsResponse(); message.channels = object.channels?.map(e => channel_1.IdentifiedChannel.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageResponse.fromAmino(object.pagination); } if (object.height !== undefined && object.height !== null) { message.height = client_1.Height.fromAmino(object.height); } return message; }, toAmino(message) { const obj = {}; if (message.channels) { obj.channels = message.channels.map(e => e ? channel_1.IdentifiedChannel.toAmino(e) : undefined); } else { obj.channels = message.channels; } obj.pagination = message.pagination ? pagination_1.PageResponse.toAmino(message.pagination) : undefined; obj.height = message.height ? client_1.Height.toAmino(message.height) : {}; return obj; }, fromAminoMsg(object) { return exports.QueryChannelsResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelsResponse", value: exports.QueryChannelsResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryChannelsResponse.decode(message.value); }, toProto(message) { return exports.QueryChannelsResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelsResponse", value: exports.QueryChannelsResponse.encode(message).finish() }; } }; function createBaseQueryConnectionChannelsRequest() { return { connection: "", pagination: undefined }; } exports.QueryConnectionChannelsRequest = { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest", encode(message, writer = binary_1.BinaryWriter.create()) { if (message.connection !== "") { writer.uint32(10).string(message.connection); } if (message.pagination !== undefined) { pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.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 = pagination_1.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 ? pagination_1.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 = pagination_1.PageRequest.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.connection = message.connection === "" ? undefined : message.connection; obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.QueryConnectionChannelsRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryConnectionChannelsRequest", value: exports.QueryConnectionChannelsRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryConnectionChannelsRequest.decode(message.value); }, toProto(message) { return exports.QueryConnectionChannelsRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest", value: exports.QueryConnectionChannelsRequest.encode(message).finish() }; } }; function createBaseQueryConnectionChannelsResponse() { return { channels: [], pagination: undefined, height: client_1.Height.fromPartial({}) }; } exports.QueryConnectionChannelsResponse = { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsResponse", encode(message, writer = binary_1.BinaryWriter.create()) { for (const v of message.channels) { channel_1.IdentifiedChannel.encode(v, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } if (message.height !== undefined) { client_1.Height.encode(message.height, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.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(channel_1.IdentifiedChannel.decode(reader, reader.uint32())); break; case 2: message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); break; case 3: message.height = client_1.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 => channel_1.IdentifiedChannel.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; message.height = object.height !== undefined && object.height !== null ? client_1.Height.fromPartial(object.height) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryConnectionChannelsResponse(); message.channels = object.channels?.map(e => channel_1.IdentifiedChannel.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageResponse.fromAmino(object.pagination); } if (object.height !== undefined && object.height !== null) { message.height = client_1.Height.fromAmino(object.height); } return message; }, toAmino(message) { const obj = {}; if (message.channels) { obj.channels = message.channels.map(e => e ? channel_1.IdentifiedChannel.toAmino(e) : undefined); } else { obj.channels = message.channels; } obj.pagination = message.pagination ? pagination_1.PageResponse.toAmino(message.pagination) : undefined; obj.height = message.height ? client_1.Height.toAmino(message.height) : {}; return obj; }, fromAminoMsg(object) { return exports.QueryConnectionChannelsResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryConnectionChannelsResponse", value: exports.QueryConnectionChannelsResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryConnectionChannelsResponse.decode(message.value); }, toProto(message) { return exports.QueryConnectionChannelsResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsResponse", value: exports.QueryConnectionChannelsResponse.encode(message).finish() }; } }; function createBaseQueryChannelClientStateRequest() { return { portId: "", channelId: "" }; } exports.QueryChannelClientStateRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateRequest", encode(message, writer = binary_1.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 binary_1.BinaryReader ? input : new binary_1.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 exports.QueryChannelClientStateRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelClientStateRequest", value: exports.QueryChannelClientStateRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryChannelClientStateRequest.decode(message.value); }, toProto(message) { return exports.QueryChannelClientStateRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateRequest", value: exports.QueryChannelClientStateRequest.encode(message).finish() }; } }; function createBaseQueryChannelClientStateResponse() { return { identifiedClientState: undefined, proof: new Uint8Array(), proofHeight: client_1.Height.fromPartial({}) }; } exports.QueryChannelClientStateResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateResponse", encode(message, writer = binary_1.BinaryWriter.create()) { if (message.identifiedClientState !== undefined) { client_1.IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); } if (message.proof.length !== 0) { writer.uint32(18).bytes(message.proof); } if (message.proofHeight !== undefined) { client_1.Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.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 = client_1.IdentifiedClientState.decode(reader, reader.uint32()); break; case 2: message.proof = reader.bytes(); break; case 3: message.proofHeight = client_1.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 ? client_1.IdentifiedClientState.fromPartial(object.identifiedClientState) : undefined; message.proof = object.proof ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? client_1.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 = client_1.IdentifiedClientState.fromAmino(object.identified_client_state); } if (object.proof !== undefined && object.proof !== null) { message.proof = (0, helpers_1.bytesFromBase64)(object.proof); } if (object.proof_height !== undefined && object.proof_height !== null) { message.proofHeight = client_1.Height.fromAmino(object.proof_height); } return message; }, toAmino(message) { const obj = {}; obj.identified_client_state = message.identifiedClientState ? client_1.IdentifiedClientState.toAmino(message.identifiedClientState) : undefined; obj.proof = message.proof ? (0, helpers_1.base64FromBytes)(message.proof) : undefined; obj.proof_height = message.proofHeight ? client_1.Height.toAmino(message.proofHeight) : {}; return obj; }, fromAminoMsg(object) { return exports.QueryChannelClientStateResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelClientStateResponse", value: exports.QueryChannelClientStateResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryChannelClientStateResponse.decode(message.value); }, toProto(message) { return exports.QueryChannelClientStateResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateResponse", value: exports.QueryChannelClientStateResponse.encode(message).finish() }; } }; function createBaseQueryChannelConsensusStateRequest() { return { portId: "", channelId: "", revisionNumber: BigInt(0), revisionHeight: BigInt(0) }; } exports.QueryChannelConsensusStateRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateRequest", encode(message, writer = binary_1.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 binary_1.BinaryReader ? input : new binary_1.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 exports.QueryChannelConsensusStateRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelConsensusStateRequest", value: exports.QueryChannelConsensusStateRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryChannelConsensusStateRequest.decode(message.value); }, toProto(message) { return exports.QueryChannelConsensusStateRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateRequest", value: exports.QueryChannelConsensusStateRequest.encode(message).finish() }; } }; function createBaseQueryChannelConsensusStateResponse() { return { consensusState: undefined, clientId: "", proof: new Uint8Array(), proofHeight: client_1.Height.fromPartial({}) }; } exports.QueryChannelConsensusStateResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateResponse", encode(message, writer = binary_1.BinaryWriter.create()) { if (message.consensusState !== undefined) { any_1.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) { client_1.Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.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_1.Any.decode(reader, reader.uint32()); break; case 2: message.clientId = reader.string(); break; case 3: message.proof = reader.bytes(); break; case 4: message.proofHeight = client_1.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_1.Any.fromPartial(object.consensusState) : undefined; message.clientId = object.clientId ?? ""; message.proof = object.proof ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? client_1.Height.fromPartial(object.proofHeight) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryChannelConsensusStateResponse(); if (object.consensus_state !== undefined && object.consensus_state !== null) { message.consensusState = any_1.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 = (0, helpers_1.bytesFromBase64)(object.proof); } if (object.proof_height !== undefined && object.proof_height !== null) { message.proofHeight = client_1.Height.fromAmino(object.proof_height); } return message; }, toAmino(message) { const obj = {}; obj.consensus_state = message.consensusState ? any_1.Any.toAmino(message.consensusState) : undefined; obj.client_id = message.clientId === "" ? undefined : message.clientId; obj.proof = message.proof ? (0, helpers_1.base64FromBytes)(message.proof) : undefined; obj.proof_height = message.proofHeight ? client_1.Height.toAmino(message.proofHeight) : {}; return obj; }, fromAminoMsg(object) { return exports.QueryChannelConsensusStateResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryChannelConsensusStateResponse", value: exports.QueryChannelConsensusStateResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryChannelConsensusStateResponse.decode(message.value); }, toProto(message) { return exports.QueryChannelConsensusStateResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateResponse", value: exports.QueryChannelConsensusStateResponse.encode(message).finish() }; } }; function createBaseQueryPacketCommitmentRequest() { return { portId: "", channelId: "", sequence: BigInt(0) }; } exports.QueryPacketCommitmentRequest = { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentRequest", encode(message, writer = binary_1.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 binary_1.BinaryReader ? input : new binary_1.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 exports.QueryPacketCommitmentRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryPacketCommitmentRequest", value: exports.QueryPacketCommitmentRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryPacketCommitmentRequest.decode(message.value); }, toProto(message) { return exports.QueryPacketCommitmentRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentRequest", value: exports.QueryPacketCommitmentRequest.encode(message).finish() }; } }; function createBaseQueryPacketCommitmentResponse() { return { commitment: new Uint8Array(), proof: new Uint8Array(), proofHeight: client_1.Height.fromPartial({}) }; } exports.QueryPacketCommitmentResponse = { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentResponse", encode(message, writer = binary_1.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) { client_1.Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketCommitmentResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.commitment = reader.bytes(); break; case 2: message.proof = reader.bytes(); break; case 3: message.proofHeight = client_1.Height.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryPacketCommitmentResponse(); message.commitment = object.commitment ?? new Uint8Array(); message.proof = object.proof ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? client_1.Height.fromPartial(object.proofHeight) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryPacketCommitmentResponse(); if (object.commitment !== undefined && object.commitment !== null) { message.commitment = (0, helpers_1.bytesFromBase64)(object.commitment); } if (object.proof !== undefined && object.proof !== null) { message.proof = (0, helpers_1.bytesFromBase64)(object.proof); } if (object.proof_height !== undefined && object.proof_height !== null) { message.proofHeight = client_1.Height.fromAmino(object.proof_height); } return message; }, toAmino(message) { const obj = {}; obj.commitment = message.commitment ? (0, helpers_1.base64FromBytes)(message.commitment) : undefined; obj.proof = message.proof ? (0, helpers_1.base64FromBytes)(message.proof) : undefined; obj.proof_height = message.proofHeight ? client_1.Height.toAmino(message.proofHeight) : {}; return obj; }, fromAminoMsg(object) { return exports.QueryPacketCommitmentResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryPacketCommitmentResponse", value: exports.QueryPacketCommitmentResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryPacketCommitmentResponse.decode(message.value); }, toProto(message) { return exports.QueryPacketCommitmentResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentResponse", value: exports.QueryPacketCommitmentResponse.encode(message).finish() }; } }; function createBaseQueryPacketCommitmentsRequest() { return { portId: "", channelId: "", pagination: undefined }; } exports.QueryPacketCommitmentsRequest = { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsRequest", encode(message, writer = binary_1.BinaryWriter.create()) { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } if (message.pagination !== undefined) { pagination_1.PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketCommitmentsRequest(); 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.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryPacketCommitmentsRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryPacketCommitmentsRequest(); 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.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageRequest.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.port_id = message.portId === "" ? undefined : message.portId; obj.channel_id = message.channelId === "" ? undefined : message.channelId; obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.QueryPacketCommitmentsRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryPacketCommitmentsRequest", value: exports.QueryPacketCommitmentsRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryPacketCommitmentsRequest.decode(message.value); }, toProto(message) { return exports.QueryPacketCommitmentsRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsRequest", value: exports.QueryPacketCommitmentsRequest.encode(message).finish() }; } }; function createBaseQueryPacketCommitmentsResponse() { return { commitments: [], pagination: undefined, height: client_1.Height.fromPartial({}) }; } exports.QueryPacketCommitmentsResponse = { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsResponse", encode(message, writer = binary_1.BinaryWriter.create()) { for (const v of message.commitments) { channel_1.PacketState.encode(v, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } if (message.height !== undefined) { client_1.Height.encode(message.height, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketCommitmentsResponse(); while (reader.pos < end) { const tag = re