UNPKG

interchainjs

Version:

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

1,229 lines (1,228 loc) 90.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MsgAcknowledgementResponse = exports.MsgAcknowledgement = exports.MsgTimeoutOnCloseResponse = exports.MsgTimeoutOnClose = exports.MsgTimeoutResponse = exports.MsgTimeout = exports.MsgRecvPacketResponse = exports.MsgRecvPacket = exports.MsgChannelCloseConfirmResponse = exports.MsgChannelCloseConfirm = exports.MsgChannelCloseInitResponse = exports.MsgChannelCloseInit = exports.MsgChannelOpenConfirmResponse = exports.MsgChannelOpenConfirm = exports.MsgChannelOpenAckResponse = exports.MsgChannelOpenAck = exports.MsgChannelOpenTryResponse = exports.MsgChannelOpenTry = exports.MsgChannelOpenInitResponse = exports.MsgChannelOpenInit = exports.ResponseResultTypeAmino = exports.ResponseResultType = void 0; exports.responseResultTypeFromJSON = responseResultTypeFromJSON; exports.responseResultTypeToJSON = responseResultTypeToJSON; const channel_1 = require("./channel"); const client_1 = require("../../client/v1/client"); const binary_1 = require("../../../../binary"); const registry_1 = require("../../../../registry"); const helpers_1 = require("../../../../helpers"); /** ResponseResultType defines the possible outcomes of the execution of a message */ var ResponseResultType; (function (ResponseResultType) { /** RESPONSE_RESULT_TYPE_UNSPECIFIED - Default zero value enumeration */ ResponseResultType[ResponseResultType["RESPONSE_RESULT_TYPE_UNSPECIFIED"] = 0] = "RESPONSE_RESULT_TYPE_UNSPECIFIED"; /** RESPONSE_RESULT_TYPE_NOOP - The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) */ ResponseResultType[ResponseResultType["RESPONSE_RESULT_TYPE_NOOP"] = 1] = "RESPONSE_RESULT_TYPE_NOOP"; /** RESPONSE_RESULT_TYPE_SUCCESS - The message was executed successfully */ ResponseResultType[ResponseResultType["RESPONSE_RESULT_TYPE_SUCCESS"] = 2] = "RESPONSE_RESULT_TYPE_SUCCESS"; /** RESPONSE_RESULT_TYPE_FAILURE - The message was executed unsuccessfully */ ResponseResultType[ResponseResultType["RESPONSE_RESULT_TYPE_FAILURE"] = 3] = "RESPONSE_RESULT_TYPE_FAILURE"; ResponseResultType[ResponseResultType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; })(ResponseResultType || (exports.ResponseResultType = ResponseResultType = {})); exports.ResponseResultTypeAmino = ResponseResultType; function responseResultTypeFromJSON(object) { switch (object) { case 0: case "RESPONSE_RESULT_TYPE_UNSPECIFIED": return ResponseResultType.RESPONSE_RESULT_TYPE_UNSPECIFIED; case 1: case "RESPONSE_RESULT_TYPE_NOOP": return ResponseResultType.RESPONSE_RESULT_TYPE_NOOP; case 2: case "RESPONSE_RESULT_TYPE_SUCCESS": return ResponseResultType.RESPONSE_RESULT_TYPE_SUCCESS; case 3: case "RESPONSE_RESULT_TYPE_FAILURE": return ResponseResultType.RESPONSE_RESULT_TYPE_FAILURE; case -1: case "UNRECOGNIZED": default: return ResponseResultType.UNRECOGNIZED; } } function responseResultTypeToJSON(object) { switch (object) { case ResponseResultType.RESPONSE_RESULT_TYPE_UNSPECIFIED: return "RESPONSE_RESULT_TYPE_UNSPECIFIED"; case ResponseResultType.RESPONSE_RESULT_TYPE_NOOP: return "RESPONSE_RESULT_TYPE_NOOP"; case ResponseResultType.RESPONSE_RESULT_TYPE_SUCCESS: return "RESPONSE_RESULT_TYPE_SUCCESS"; case ResponseResultType.RESPONSE_RESULT_TYPE_FAILURE: return "RESPONSE_RESULT_TYPE_FAILURE"; case ResponseResultType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } function createBaseMsgChannelOpenInit() { return { portId: "", channel: channel_1.Channel.fromPartial({}), signer: "" }; } /** * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It * is called by a relayer on Chain A. * @name MsgChannelOpenInit * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelOpenInit */ exports.MsgChannelOpenInit = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", aminoType: "cosmos-sdk/MsgChannelOpenInit", is(o) { return o && (o.$typeUrl === exports.MsgChannelOpenInit.typeUrl || typeof o.portId === "string" && channel_1.Channel.is(o.channel) && typeof o.signer === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.MsgChannelOpenInit.typeUrl || typeof o.port_id === "string" && channel_1.Channel.isAmino(o.channel) && typeof o.signer === "string"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channel !== undefined) { channel_1.Channel.encode(message.channel, writer.uint32(18).fork()).ldelim(); } if (message.signer !== "") { writer.uint32(26).string(message.signer); } 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 = createBaseMsgChannelOpenInit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.portId = reader.string(); break; case 2: message.channel = channel_1.Channel.decode(reader, reader.uint32()); break; case 3: message.signer = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseMsgChannelOpenInit(); message.portId = object.portId ?? ""; message.channel = object.channel !== undefined && object.channel !== null ? channel_1.Channel.fromPartial(object.channel) : undefined; message.signer = object.signer ?? ""; return message; }, fromAmino(object) { const message = createBaseMsgChannelOpenInit(); if (object.port_id !== undefined && object.port_id !== null) { message.portId = object.port_id; } if (object.channel !== undefined && object.channel !== null) { message.channel = channel_1.Channel.fromAmino(object.channel); } if (object.signer !== undefined && object.signer !== null) { message.signer = object.signer; } return message; }, toAmino(message) { const obj = {}; obj.port_id = message.portId === "" ? undefined : message.portId; obj.channel = message.channel ? channel_1.Channel.toAmino(message.channel) : undefined; obj.signer = message.signer === "" ? undefined : message.signer; return obj; }, fromAminoMsg(object) { return exports.MsgChannelOpenInit.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/MsgChannelOpenInit", value: exports.MsgChannelOpenInit.toAmino(message) }; }, fromProtoMsg(message) { return exports.MsgChannelOpenInit.decode(message.value); }, toProto(message) { return exports.MsgChannelOpenInit.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", value: exports.MsgChannelOpenInit.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.MsgChannelOpenInit.typeUrl)) { return; } channel_1.Channel.registerTypeUrl(); } }; function createBaseMsgChannelOpenInitResponse() { return { channelId: "", version: "" }; } /** * MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. * @name MsgChannelOpenInitResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelOpenInitResponse */ exports.MsgChannelOpenInitResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse", aminoType: "cosmos-sdk/MsgChannelOpenInitResponse", is(o) { return o && (o.$typeUrl === exports.MsgChannelOpenInitResponse.typeUrl || typeof o.channelId === "string" && typeof o.version === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.MsgChannelOpenInitResponse.typeUrl || typeof o.channel_id === "string" && typeof o.version === "string"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); } if (message.version !== "") { writer.uint32(18).string(message.version); } 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 = createBaseMsgChannelOpenInitResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.channelId = reader.string(); break; case 2: message.version = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseMsgChannelOpenInitResponse(); message.channelId = object.channelId ?? ""; message.version = object.version ?? ""; return message; }, fromAmino(object) { const message = createBaseMsgChannelOpenInitResponse(); if (object.channel_id !== undefined && object.channel_id !== null) { message.channelId = object.channel_id; } if (object.version !== undefined && object.version !== null) { message.version = object.version; } return message; }, toAmino(message) { const obj = {}; obj.channel_id = message.channelId === "" ? undefined : message.channelId; obj.version = message.version === "" ? undefined : message.version; return obj; }, fromAminoMsg(object) { return exports.MsgChannelOpenInitResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/MsgChannelOpenInitResponse", value: exports.MsgChannelOpenInitResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.MsgChannelOpenInitResponse.decode(message.value); }, toProto(message) { return exports.MsgChannelOpenInitResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse", value: exports.MsgChannelOpenInitResponse.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseMsgChannelOpenTry() { return { portId: "", previousChannelId: "", channel: channel_1.Channel.fromPartial({}), counterpartyVersion: "", proofInit: new Uint8Array(), proofHeight: client_1.Height.fromPartial({}), signer: "" }; } /** * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel * on Chain B. The version field within the Channel field has been deprecated. Its * value will be ignored by core IBC. * @name MsgChannelOpenTry * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelOpenTry */ exports.MsgChannelOpenTry = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", aminoType: "cosmos-sdk/MsgChannelOpenTry", is(o) { return o && (o.$typeUrl === exports.MsgChannelOpenTry.typeUrl || typeof o.portId === "string" && typeof o.previousChannelId === "string" && channel_1.Channel.is(o.channel) && typeof o.counterpartyVersion === "string" && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && client_1.Height.is(o.proofHeight) && typeof o.signer === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.MsgChannelOpenTry.typeUrl || typeof o.port_id === "string" && typeof o.previous_channel_id === "string" && channel_1.Channel.isAmino(o.channel) && typeof o.counterparty_version === "string" && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && client_1.Height.isAmino(o.proof_height) && typeof o.signer === "string"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.previousChannelId !== "") { writer.uint32(18).string(message.previousChannelId); } if (message.channel !== undefined) { channel_1.Channel.encode(message.channel, writer.uint32(26).fork()).ldelim(); } if (message.counterpartyVersion !== "") { writer.uint32(34).string(message.counterpartyVersion); } if (message.proofInit.length !== 0) { writer.uint32(42).bytes(message.proofInit); } if (message.proofHeight !== undefined) { client_1.Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); } if (message.signer !== "") { writer.uint32(58).string(message.signer); } 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 = createBaseMsgChannelOpenTry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.portId = reader.string(); break; case 2: message.previousChannelId = reader.string(); break; case 3: message.channel = channel_1.Channel.decode(reader, reader.uint32()); break; case 4: message.counterpartyVersion = reader.string(); break; case 5: message.proofInit = reader.bytes(); break; case 6: message.proofHeight = client_1.Height.decode(reader, reader.uint32()); break; case 7: message.signer = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseMsgChannelOpenTry(); message.portId = object.portId ?? ""; message.previousChannelId = object.previousChannelId ?? ""; message.channel = object.channel !== undefined && object.channel !== null ? channel_1.Channel.fromPartial(object.channel) : undefined; message.counterpartyVersion = object.counterpartyVersion ?? ""; message.proofInit = object.proofInit ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? client_1.Height.fromPartial(object.proofHeight) : undefined; message.signer = object.signer ?? ""; return message; }, fromAmino(object) { const message = createBaseMsgChannelOpenTry(); if (object.port_id !== undefined && object.port_id !== null) { message.portId = object.port_id; } if (object.previous_channel_id !== undefined && object.previous_channel_id !== null) { message.previousChannelId = object.previous_channel_id; } if (object.channel !== undefined && object.channel !== null) { message.channel = channel_1.Channel.fromAmino(object.channel); } if (object.counterparty_version !== undefined && object.counterparty_version !== null) { message.counterpartyVersion = object.counterparty_version; } if (object.proof_init !== undefined && object.proof_init !== null) { message.proofInit = (0, helpers_1.bytesFromBase64)(object.proof_init); } if (object.proof_height !== undefined && object.proof_height !== null) { message.proofHeight = client_1.Height.fromAmino(object.proof_height); } if (object.signer !== undefined && object.signer !== null) { message.signer = object.signer; } return message; }, toAmino(message) { const obj = {}; obj.port_id = message.portId === "" ? undefined : message.portId; obj.previous_channel_id = message.previousChannelId === "" ? undefined : message.previousChannelId; obj.channel = message.channel ? channel_1.Channel.toAmino(message.channel) : undefined; obj.counterparty_version = message.counterpartyVersion === "" ? undefined : message.counterpartyVersion; obj.proof_init = message.proofInit ? (0, helpers_1.base64FromBytes)(message.proofInit) : undefined; obj.proof_height = message.proofHeight ? client_1.Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer === "" ? undefined : message.signer; return obj; }, fromAminoMsg(object) { return exports.MsgChannelOpenTry.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/MsgChannelOpenTry", value: exports.MsgChannelOpenTry.toAmino(message) }; }, fromProtoMsg(message) { return exports.MsgChannelOpenTry.decode(message.value); }, toProto(message) { return exports.MsgChannelOpenTry.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", value: exports.MsgChannelOpenTry.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.MsgChannelOpenTry.typeUrl)) { return; } channel_1.Channel.registerTypeUrl(); client_1.Height.registerTypeUrl(); } }; function createBaseMsgChannelOpenTryResponse() { return { version: "", channelId: "" }; } /** * MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. * @name MsgChannelOpenTryResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelOpenTryResponse */ exports.MsgChannelOpenTryResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse", aminoType: "cosmos-sdk/MsgChannelOpenTryResponse", is(o) { return o && (o.$typeUrl === exports.MsgChannelOpenTryResponse.typeUrl || typeof o.version === "string" && typeof o.channelId === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.MsgChannelOpenTryResponse.typeUrl || typeof o.version === "string" && typeof o.channel_id === "string"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.version !== "") { writer.uint32(10).string(message.version); } 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 = createBaseMsgChannelOpenTryResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.version = reader.string(); break; case 2: message.channelId = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseMsgChannelOpenTryResponse(); message.version = object.version ?? ""; message.channelId = object.channelId ?? ""; return message; }, fromAmino(object) { const message = createBaseMsgChannelOpenTryResponse(); if (object.version !== undefined && object.version !== null) { message.version = object.version; } if (object.channel_id !== undefined && object.channel_id !== null) { message.channelId = object.channel_id; } return message; }, toAmino(message) { const obj = {}; obj.version = message.version === "" ? undefined : message.version; obj.channel_id = message.channelId === "" ? undefined : message.channelId; return obj; }, fromAminoMsg(object) { return exports.MsgChannelOpenTryResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/MsgChannelOpenTryResponse", value: exports.MsgChannelOpenTryResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.MsgChannelOpenTryResponse.decode(message.value); }, toProto(message) { return exports.MsgChannelOpenTryResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse", value: exports.MsgChannelOpenTryResponse.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseMsgChannelOpenAck() { return { portId: "", channelId: "", counterpartyChannelId: "", counterpartyVersion: "", proofTry: new Uint8Array(), proofHeight: client_1.Height.fromPartial({}), signer: "" }; } /** * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge * the change of channel state to TRYOPEN on Chain B. * @name MsgChannelOpenAck * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelOpenAck */ exports.MsgChannelOpenAck = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", aminoType: "cosmos-sdk/MsgChannelOpenAck", is(o) { return o && (o.$typeUrl === exports.MsgChannelOpenAck.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.counterpartyChannelId === "string" && typeof o.counterpartyVersion === "string" && (o.proofTry instanceof Uint8Array || typeof o.proofTry === "string") && client_1.Height.is(o.proofHeight) && typeof o.signer === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.MsgChannelOpenAck.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.counterparty_channel_id === "string" && typeof o.counterparty_version === "string" && (o.proof_try instanceof Uint8Array || typeof o.proof_try === "string") && client_1.Height.isAmino(o.proof_height) && typeof o.signer === "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); } if (message.counterpartyChannelId !== "") { writer.uint32(26).string(message.counterpartyChannelId); } if (message.counterpartyVersion !== "") { writer.uint32(34).string(message.counterpartyVersion); } if (message.proofTry.length !== 0) { writer.uint32(42).bytes(message.proofTry); } if (message.proofHeight !== undefined) { client_1.Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); } if (message.signer !== "") { writer.uint32(58).string(message.signer); } 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 = createBaseMsgChannelOpenAck(); 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.counterpartyChannelId = reader.string(); break; case 4: message.counterpartyVersion = reader.string(); break; case 5: message.proofTry = reader.bytes(); break; case 6: message.proofHeight = client_1.Height.decode(reader, reader.uint32()); break; case 7: message.signer = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseMsgChannelOpenAck(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; message.counterpartyChannelId = object.counterpartyChannelId ?? ""; message.counterpartyVersion = object.counterpartyVersion ?? ""; message.proofTry = object.proofTry ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? client_1.Height.fromPartial(object.proofHeight) : undefined; message.signer = object.signer ?? ""; return message; }, fromAmino(object) { const message = createBaseMsgChannelOpenAck(); 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.counterparty_channel_id !== undefined && object.counterparty_channel_id !== null) { message.counterpartyChannelId = object.counterparty_channel_id; } if (object.counterparty_version !== undefined && object.counterparty_version !== null) { message.counterpartyVersion = object.counterparty_version; } if (object.proof_try !== undefined && object.proof_try !== null) { message.proofTry = (0, helpers_1.bytesFromBase64)(object.proof_try); } if (object.proof_height !== undefined && object.proof_height !== null) { message.proofHeight = client_1.Height.fromAmino(object.proof_height); } if (object.signer !== undefined && object.signer !== null) { message.signer = object.signer; } return message; }, toAmino(message) { const obj = {}; obj.port_id = message.portId === "" ? undefined : message.portId; obj.channel_id = message.channelId === "" ? undefined : message.channelId; obj.counterparty_channel_id = message.counterpartyChannelId === "" ? undefined : message.counterpartyChannelId; obj.counterparty_version = message.counterpartyVersion === "" ? undefined : message.counterpartyVersion; obj.proof_try = message.proofTry ? (0, helpers_1.base64FromBytes)(message.proofTry) : undefined; obj.proof_height = message.proofHeight ? client_1.Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer === "" ? undefined : message.signer; return obj; }, fromAminoMsg(object) { return exports.MsgChannelOpenAck.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/MsgChannelOpenAck", value: exports.MsgChannelOpenAck.toAmino(message) }; }, fromProtoMsg(message) { return exports.MsgChannelOpenAck.decode(message.value); }, toProto(message) { return exports.MsgChannelOpenAck.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", value: exports.MsgChannelOpenAck.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.MsgChannelOpenAck.typeUrl)) { return; } client_1.Height.registerTypeUrl(); } }; function createBaseMsgChannelOpenAckResponse() { return {}; } /** * MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. * @name MsgChannelOpenAckResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelOpenAckResponse */ exports.MsgChannelOpenAckResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse", aminoType: "cosmos-sdk/MsgChannelOpenAckResponse", is(o) { return o && o.$typeUrl === exports.MsgChannelOpenAckResponse.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.MsgChannelOpenAckResponse.typeUrl; }, encode(_, writer = binary_1.BinaryWriter.create()) { 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 = createBaseMsgChannelOpenAckResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_) { const message = createBaseMsgChannelOpenAckResponse(); return message; }, fromAmino(_) { const message = createBaseMsgChannelOpenAckResponse(); return message; }, toAmino(_) { const obj = {}; return obj; }, fromAminoMsg(object) { return exports.MsgChannelOpenAckResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/MsgChannelOpenAckResponse", value: exports.MsgChannelOpenAckResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.MsgChannelOpenAckResponse.decode(message.value); }, toProto(message) { return exports.MsgChannelOpenAckResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse", value: exports.MsgChannelOpenAckResponse.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseMsgChannelOpenConfirm() { return { portId: "", channelId: "", proofAck: new Uint8Array(), proofHeight: client_1.Height.fromPartial({}), signer: "" }; } /** * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to * acknowledge the change of channel state to OPEN on Chain A. * @name MsgChannelOpenConfirm * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelOpenConfirm */ exports.MsgChannelOpenConfirm = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", aminoType: "cosmos-sdk/MsgChannelOpenConfirm", is(o) { return o && (o.$typeUrl === exports.MsgChannelOpenConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && (o.proofAck instanceof Uint8Array || typeof o.proofAck === "string") && client_1.Height.is(o.proofHeight) && typeof o.signer === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.MsgChannelOpenConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && (o.proof_ack instanceof Uint8Array || typeof o.proof_ack === "string") && client_1.Height.isAmino(o.proof_height) && typeof o.signer === "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); } if (message.proofAck.length !== 0) { writer.uint32(26).bytes(message.proofAck); } if (message.proofHeight !== undefined) { client_1.Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); } if (message.signer !== "") { writer.uint32(42).string(message.signer); } 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 = createBaseMsgChannelOpenConfirm(); 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.proofAck = reader.bytes(); break; case 4: message.proofHeight = client_1.Height.decode(reader, reader.uint32()); break; case 5: message.signer = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseMsgChannelOpenConfirm(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; message.proofAck = object.proofAck ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? client_1.Height.fromPartial(object.proofHeight) : undefined; message.signer = object.signer ?? ""; return message; }, fromAmino(object) { const message = createBaseMsgChannelOpenConfirm(); 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.proof_ack !== undefined && object.proof_ack !== null) { message.proofAck = (0, helpers_1.bytesFromBase64)(object.proof_ack); } if (object.proof_height !== undefined && object.proof_height !== null) { message.proofHeight = client_1.Height.fromAmino(object.proof_height); } if (object.signer !== undefined && object.signer !== null) { message.signer = object.signer; } return message; }, toAmino(message) { const obj = {}; obj.port_id = message.portId === "" ? undefined : message.portId; obj.channel_id = message.channelId === "" ? undefined : message.channelId; obj.proof_ack = message.proofAck ? (0, helpers_1.base64FromBytes)(message.proofAck) : undefined; obj.proof_height = message.proofHeight ? client_1.Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer === "" ? undefined : message.signer; return obj; }, fromAminoMsg(object) { return exports.MsgChannelOpenConfirm.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/MsgChannelOpenConfirm", value: exports.MsgChannelOpenConfirm.toAmino(message) }; }, fromProtoMsg(message) { return exports.MsgChannelOpenConfirm.decode(message.value); }, toProto(message) { return exports.MsgChannelOpenConfirm.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", value: exports.MsgChannelOpenConfirm.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.MsgChannelOpenConfirm.typeUrl)) { return; } client_1.Height.registerTypeUrl(); } }; function createBaseMsgChannelOpenConfirmResponse() { return {}; } /** * MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response * type. * @name MsgChannelOpenConfirmResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelOpenConfirmResponse */ exports.MsgChannelOpenConfirmResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse", aminoType: "cosmos-sdk/MsgChannelOpenConfirmResponse", is(o) { return o && o.$typeUrl === exports.MsgChannelOpenConfirmResponse.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.MsgChannelOpenConfirmResponse.typeUrl; }, encode(_, writer = binary_1.BinaryWriter.create()) { 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 = createBaseMsgChannelOpenConfirmResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_) { const message = createBaseMsgChannelOpenConfirmResponse(); return message; }, fromAmino(_) { const message = createBaseMsgChannelOpenConfirmResponse(); return message; }, toAmino(_) { const obj = {}; return obj; }, fromAminoMsg(object) { return exports.MsgChannelOpenConfirmResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/MsgChannelOpenConfirmResponse", value: exports.MsgChannelOpenConfirmResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.MsgChannelOpenConfirmResponse.decode(message.value); }, toProto(message) { return exports.MsgChannelOpenConfirmResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse", value: exports.MsgChannelOpenConfirmResponse.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseMsgChannelCloseInit() { return { portId: "", channelId: "", signer: "" }; } /** * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A * to close a channel with Chain B. * @name MsgChannelCloseInit * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelCloseInit */ exports.MsgChannelCloseInit = { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", aminoType: "cosmos-sdk/MsgChannelCloseInit", is(o) { return o && (o.$typeUrl === exports.MsgChannelCloseInit.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.signer === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.MsgChannelCloseInit.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.signer === "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); } if (message.signer !== "") { writer.uint32(26).string(message.signer); } 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 = createBaseMsgChannelCloseInit(); 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.signer = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseMsgChannelCloseInit(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; message.signer = object.signer ?? ""; return message; }, fromAmino(object) { const message = createBaseMsgChannelCloseInit(); 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.signer !== undefined && object.signer !== null) { message.signer = object.signer; } return message; }, toAmino(message) { const obj = {}; obj.port_id = message.portId === "" ? undefined : message.portId; obj.channel_id = message.channelId === "" ? undefined : message.channelId; obj.signer = message.signer === "" ? undefined : message.signer; return obj; }, fromAminoMsg(object) { return exports.MsgChannelCloseInit.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/MsgChannelCloseInit", value: exports.MsgChannelCloseInit.toAmino(message) }; }, fromProtoMsg(message) { return exports.MsgChannelCloseInit.decode(message.value); }, toProto(message) { return exports.MsgChannelCloseInit.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", value: exports.MsgChannelCloseInit.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseMsgChannelCloseInitResponse() { return {}; } /** * MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. * @name MsgChannelCloseInitResponse * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelCloseInitResponse */ exports.MsgChannelCloseInitResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse", aminoType: "cosmos-sdk/MsgChannelCloseInitResponse", is(o) { return o && o.$typeUrl === exports.MsgChannelCloseInitResponse.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.MsgChannelCloseInitResponse.typeUrl; }, encode(_, writer = binary_1.BinaryWriter.create()) { 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 = createBaseMsgChannelCloseInitResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_) { const message = createBaseMsgChannelCloseInitResponse(); return message; }, fromAmino(_) { const message = createBaseMsgChannelCloseInitResponse(); return message; }, toAmino(_) { const obj = {}; return obj; }, fromAminoMsg(object) { return exports.MsgChannelCloseInitResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/MsgChannelCloseInitResponse", value: exports.MsgChannelCloseInitResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.MsgChannelCloseInitResponse.decode(message.value); }, toProto(message) { return exports.MsgChannelCloseInitResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse", value: exports.MsgChannelCloseInitResponse.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseMsgChannelCloseConfirm() { return { portId: "", channelId: "", proofInit: new Uint8Array(), proofHeight: client_1.Height.fromPartial({}), signer: "" }; } /** * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B * to acknowledge the change of channel state to CLOSED on Chain A. * @name MsgChannelCloseConfirm * @package ibc.core.channel.v1 * @see proto type: ibc.core.channel.v1.MsgChannelCloseConfirm */ exports.MsgChannelCloseConfirm = { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", aminoType: "cosmos-sdk/MsgChannelCloseConfirm", is(o) { return o && (o.$typeUrl === exports.MsgChannelCloseConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && client_1.Height.is(o.proofHeight) && typeof o.signer === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.MsgChannelCloseConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && client_1.Height.isAmino(o.proof_height) && typeof o.signer === "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); } if (message.proofInit.length !== 0) { writer.uint32(26).bytes(message.proofInit); } if (message.proofHeight !== undefined) { client_1.Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); } if (message.signer !== "") { writer.uint32(42).string(message.signer); } 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 = createBaseMsgChannelCloseConfirm(); 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.proofInit = reader.bytes(); break; case 4: message.proofHeight = client_1.Height.decode(reader, reader.uint32()); break; case 5: message.signer = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseMsgChannelCloseConfirm(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; message.proofInit = object.proofInit ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? client_1.Height.fromPartial(object.proofHeight) : undefined; message.signer = object.signer ?? ""; return message; }, fromAmino(object) { const message = createBaseMsgChannelCloseConfirm(); if (object.port_id !== undefined && object.port_id !== null) { message.portId = object.port_id; }