interchainjs
Version:
InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.
1,173 lines • 132 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryNextSequenceSendResponse = exports.QueryNextSequenceSendRequest = 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;
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");
const registry_1 = require("../../../../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
*/
exports.QueryChannelRequest = {
typeUrl: "/ibc.core.channel.v1.QueryChannelRequest",
aminoType: "cosmos-sdk/QueryChannelRequest",
is(o) {
return o && (o.$typeUrl === exports.QueryChannelRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string");
},
isAmino(o) {
return o && (o.$typeUrl === exports.QueryChannelRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string");
},
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()
};
},
registerTypeUrl() { }
};
function createBaseQueryChannelResponse() {
return {
channel: undefined,
proof: new Uint8Array(),
proofHeight: client_1.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
*/
exports.QueryChannelResponse = {
typeUrl: "/ibc.core.channel.v1.QueryChannelResponse",
aminoType: "cosmos-sdk/QueryChannelResponse",
is(o) {
return o && (o.$typeUrl === exports.QueryChannelResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && client_1.Height.is(o.proofHeight));
},
isAmino(o) {
return o && (o.$typeUrl === exports.QueryChannelResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && client_1.Height.isAmino(o.proof_height));
},
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()
};
},
registerTypeUrl() {
if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryChannelResponse.typeUrl)) {
return;
}
channel_1.Channel.registerTypeUrl();
client_1.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
*/
exports.QueryChannelsRequest = {
typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest",
aminoType: "cosmos-sdk/QueryChannelsRequest",
is(o) {
return o && o.$typeUrl === exports.QueryChannelsRequest.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === exports.QueryChannelsRequest.typeUrl;
},
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()
};
},
registerTypeUrl() {
if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryChannelsRequest.typeUrl)) {
return;
}
pagination_1.PageRequest.registerTypeUrl();
}
};
function createBaseQueryChannelsResponse() {
return {
channels: [],
pagination: undefined,
height: client_1.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
*/
exports.QueryChannelsResponse = {
typeUrl: "/ibc.core.channel.v1.QueryChannelsResponse",
aminoType: "cosmos-sdk/QueryChannelsResponse",
is(o) {
return o && (o.$typeUrl === exports.QueryChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || channel_1.IdentifiedChannel.is(o.channels[0])) && client_1.Height.is(o.height));
},
isAmino(o) {
return o && (o.$typeUrl === exports.QueryChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || channel_1.IdentifiedChannel.isAmino(o.channels[0])) && client_1.Height.isAmino(o.height));
},
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()
};
},
registerTypeUrl() {
if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryChannelsResponse.typeUrl)) {
return;
}
channel_1.IdentifiedChannel.registerTypeUrl();
pagination_1.PageResponse.registerTypeUrl();
client_1.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
*/
exports.QueryConnectionChannelsRequest = {
typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest",
aminoType: "cosmos-sdk/QueryConnectionChannelsRequest",
is(o) {
return o && (o.$typeUrl === exports.QueryConnectionChannelsRequest.typeUrl || typeof o.connection === "string");
},
isAmino(o) {
return o && (o.$typeUrl === exports.QueryConnectionChannelsRequest.typeUrl || typeof o.connection === "string");
},
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()
};
},
registerTypeUrl() {
if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryConnectionChannelsRequest.typeUrl)) {
return;
}
pagination_1.PageRequest.registerTypeUrl();
}
};
function createBaseQueryConnectionChannelsResponse() {
return {
channels: [],
pagination: undefined,
height: client_1.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
*/
exports.QueryConnectionChannelsResponse = {
typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsResponse",
aminoType: "cosmos-sdk/QueryConnectionChannelsResponse",
is(o) {
return o && (o.$typeUrl === exports.QueryConnectionChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || channel_1.IdentifiedChannel.is(o.channels[0])) && client_1.Height.is(o.height));
},
isAmino(o) {
return o && (o.$typeUrl === exports.QueryConnectionChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || channel_1.IdentifiedChannel.isAmino(o.channels[0])) && client_1.Height.isAmino(o.height));
},
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()
};
},
registerTypeUrl() {
if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryConnectionChannelsResponse.typeUrl)) {
return;
}
channel_1.IdentifiedChannel.registerTypeUrl();
pagination_1.PageResponse.registerTypeUrl();
client_1.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
*/
exports.QueryChannelClientStateRequest = {
typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateRequest",
aminoType: "cosmos-sdk/QueryChannelClientStateRequest",
is(o) {
return o && (o.$typeUrl === exports.QueryChannelClientStateRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string");
},
isAmino(o) {
return o && (o.$typeUrl === exports.QueryChannelClientStateRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string");
},
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()
};
},
registerTypeUrl() { }
};
function createBaseQueryChannelClientStateResponse() {
return {
identifiedClientState: undefined,
proof: new Uint8Array(),
proofHeight: client_1.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
*/
exports.QueryChannelClientStateResponse = {
typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateResponse",
aminoType: "cosmos-sdk/QueryChannelClientStateResponse",
is(o) {
return o && (o.$typeUrl === exports.QueryChannelClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && client_1.Height.is(o.proofHeight));
},
isAmino(o) {
return o && (o.$typeUrl === exports.QueryChannelClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && client_1.Height.isAmino(o.proof_height));
},
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()
};
},
registerTypeUrl() {
if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryChannelClientStateResponse.typeUrl)) {
return;
}
client_1.IdentifiedClientState.registerTypeUrl();
client_1.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
*/
exports.QueryChannelConsensusStateRequest = {
typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateRequest",
aminoType: "cosmos-sdk/QueryChannelConsensusStateRequest",
is(o) {
return o && (o.$typeUrl === exports.QueryChannelConsensusStateRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.revisionNumber === "bigint" && typeof o.revisionHeight === "bigint");
},
isAmino(o) {
return o && (o.$typeUrl === exports.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 = 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()
};
},
registerTypeUrl() { }
};
function createBaseQueryChannelConsensusStateResponse() {
return {
consensusState: undefined,
clientId: "",
proof: new Uint8Array(),
proofHeight: client_1.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
*/
exports.QueryChannelConsensusStateResponse = {
typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateResponse",
aminoType: "cosmos-sdk/QueryChannelConsensusStateResponse",
is(o) {
return o && (o.$typeUrl === exports.QueryChannelConsensusStateResponse.typeUrl || typeof o.clientId === "string" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && client_1.Height.is(o.proofHeight));
},
isAmino(o) {
return o && (o.$typeUrl === exports.QueryChannelConsensusStateResponse.typeUrl || typeof o.client_id === "string" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && client_1.Height.isAmino(o.proof_height));
},
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()
};
},
registerTypeUrl() {
if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryChannelConsensusStateResponse.typeUrl)) {
return;
}
client_1.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
*/
exports.QueryPacketCommitmentRequest = {
typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentRequest",
aminoType: "cosmos-sdk/QueryPacketCommitmentRequest",
is(o) {
return o && (o.$typeUrl === exports.QueryPacketCommitmentRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint");
},
isAmino(o) {
return o && (o.$typeUrl === exports.QueryPacketCommitmentRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint");
},
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