// @generated by protoc-gen-es v1.2.0 with parameter "target=ts" // @generated from file ibc/core/channel/v1/channel.proto (package ibc.core.channel.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { Height } from "../../client/v1/client_pb.js"; /** * State defines if a channel is in one of the following states: * CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. * * @generated from enum ibc.core.channel.v1.State */ export enum State { /** * Default State * * @generated from enum value: STATE_UNINITIALIZED_UNSPECIFIED = 0; */ UNINITIALIZED_UNSPECIFIED = 0, /** * A channel has just started the opening handshake. * * @generated from enum value: STATE_INIT = 1; */ INIT = 1, /** * A channel has acknowledged the handshake step on the counterparty chain. * * @generated from enum value: STATE_TRYOPEN = 2; */ TRYOPEN = 2, /** * A channel has completed the handshake. Open channels are * ready to send and receive packets. * * @generated from enum value: STATE_OPEN = 3; */ OPEN = 3, /** * A channel has been closed and can no longer be used to send or receive * packets. * * @generated from enum value: STATE_CLOSED = 4; */ CLOSED = 4, /** * A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. * * @generated from enum value: STATE_FLUSHING = 5; */ FLUSHING = 5, /** * A channel has just completed flushing any in-flight packets. * * @generated from enum value: STATE_FLUSHCOMPLETE = 6; */ FLUSHCOMPLETE = 6, } // Retrieve enum metadata with: proto3.getEnumType(State) proto3.util.setEnumType(State, "ibc.core.channel.v1.State", [ { no: 0, name: "STATE_UNINITIALIZED_UNSPECIFIED" }, { no: 1, name: "STATE_INIT" }, { no: 2, name: "STATE_TRYOPEN" }, { no: 3, name: "STATE_OPEN" }, { no: 4, name: "STATE_CLOSED" }, { no: 5, name: "STATE_FLUSHING" }, { no: 6, name: "STATE_FLUSHCOMPLETE" }, ]); /** * Order defines if a channel is ORDERED or UNORDERED * * @generated from enum ibc.core.channel.v1.Order */ export enum Order { /** * zero-value for channel ordering * * @generated from enum value: ORDER_NONE_UNSPECIFIED = 0; */ NONE_UNSPECIFIED = 0, /** * packets can be delivered in any order, which may differ from the order in * which they were sent. * * @generated from enum value: ORDER_UNORDERED = 1; */ UNORDERED = 1, /** * packets are delivered exactly in the order which they were sent * * @generated from enum value: ORDER_ORDERED = 2; */ ORDERED = 2, } // Retrieve enum metadata with: proto3.getEnumType(Order) proto3.util.setEnumType(Order, "ibc.core.channel.v1.Order", [ { no: 0, name: "ORDER_NONE_UNSPECIFIED" }, { no: 1, name: "ORDER_UNORDERED" }, { no: 2, name: "ORDER_ORDERED" }, ]); /** * Channel defines pipeline for exactly-once packet delivery between specific * modules on separate blockchains, which has at least one end capable of * sending packets and one end capable of receiving packets. * * @generated from message ibc.core.channel.v1.Channel */ export class Channel extends Message { /** * current state of the channel end * * @generated from field: ibc.core.channel.v1.State state = 1; */ state = State.UNINITIALIZED_UNSPECIFIED; /** * whether the channel is ordered or unordered * * @generated from field: ibc.core.channel.v1.Order ordering = 2; */ ordering = Order.NONE_UNSPECIFIED; /** * counterparty channel end * * @generated from field: ibc.core.channel.v1.Counterparty counterparty = 3; */ counterparty?: Counterparty; /** * list of connection identifiers, in order, along which packets sent on * this channel will travel * * @generated from field: repeated string connection_hops = 4; */ connectionHops: string[] = []; /** * opaque channel version, which is agreed upon during the handshake * * @generated from field: string version = 5; */ version = ""; /** * upgrade sequence indicates the latest upgrade attempt performed by this channel * the value of 0 indicates the channel has never been upgraded * * @generated from field: uint64 upgrade_sequence = 6; */ upgradeSequence = protoInt64.zero; constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ibc.core.channel.v1.Channel"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "state", kind: "enum", T: proto3.getEnumType(State) }, { no: 2, name: "ordering", kind: "enum", T: proto3.getEnumType(Order) }, { no: 3, name: "counterparty", kind: "message", T: Counterparty }, { no: 4, name: "connection_hops", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 5, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 6, name: "upgrade_sequence", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Channel { return new Channel().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): Channel { return new Channel().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): Channel { return new Channel().fromJsonString(jsonString, options); } static equals(a: Channel | PlainMessage | undefined, b: Channel | PlainMessage | undefined): boolean { return proto3.util.equals(Channel, a, b); } } /** * IdentifiedChannel defines a channel with additional port and channel * identifier fields. * * @generated from message ibc.core.channel.v1.IdentifiedChannel */ export class IdentifiedChannel extends Message { /** * current state of the channel end * * @generated from field: ibc.core.channel.v1.State state = 1; */ state = State.UNINITIALIZED_UNSPECIFIED; /** * whether the channel is ordered or unordered * * @generated from field: ibc.core.channel.v1.Order ordering = 2; */ ordering = Order.NONE_UNSPECIFIED; /** * counterparty channel end * * @generated from field: ibc.core.channel.v1.Counterparty counterparty = 3; */ counterparty?: Counterparty; /** * list of connection identifiers, in order, along which packets sent on * this channel will travel * * @generated from field: repeated string connection_hops = 4; */ connectionHops: string[] = []; /** * opaque channel version, which is agreed upon during the handshake * * @generated from field: string version = 5; */ version = ""; /** * port identifier * * @generated from field: string port_id = 6; */ portId = ""; /** * channel identifier * * @generated from field: string channel_id = 7; */ channelId = ""; /** * upgrade sequence indicates the latest upgrade attempt performed by this channel * the value of 0 indicates the channel has never been upgraded * * @generated from field: uint64 upgrade_sequence = 8; */ upgradeSequence = protoInt64.zero; constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ibc.core.channel.v1.IdentifiedChannel"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "state", kind: "enum", T: proto3.getEnumType(State) }, { no: 2, name: "ordering", kind: "enum", T: proto3.getEnumType(Order) }, { no: 3, name: "counterparty", kind: "message", T: Counterparty }, { no: 4, name: "connection_hops", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 5, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 6, name: "port_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 7, name: "channel_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 8, name: "upgrade_sequence", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): IdentifiedChannel { return new IdentifiedChannel().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): IdentifiedChannel { return new IdentifiedChannel().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): IdentifiedChannel { return new IdentifiedChannel().fromJsonString(jsonString, options); } static equals(a: IdentifiedChannel | PlainMessage | undefined, b: IdentifiedChannel | PlainMessage | undefined): boolean { return proto3.util.equals(IdentifiedChannel, a, b); } } /** * Counterparty defines a channel end counterparty * * @generated from message ibc.core.channel.v1.Counterparty */ export class Counterparty extends Message { /** * port on the counterparty chain which owns the other end of the channel. * * @generated from field: string port_id = 1; */ portId = ""; /** * channel end on the counterparty chain * * @generated from field: string channel_id = 2; */ channelId = ""; constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ibc.core.channel.v1.Counterparty"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "port_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "channel_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Counterparty { return new Counterparty().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): Counterparty { return new Counterparty().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): Counterparty { return new Counterparty().fromJsonString(jsonString, options); } static equals(a: Counterparty | PlainMessage | undefined, b: Counterparty | PlainMessage | undefined): boolean { return proto3.util.equals(Counterparty, a, b); } } /** * Packet defines a type that carries data across different chains through IBC * * @generated from message ibc.core.channel.v1.Packet */ export class Packet extends Message { /** * number corresponds to the order of sends and receives, where a Packet * with an earlier sequence number must be sent and received before a Packet * with a later sequence number. * * @generated from field: uint64 sequence = 1; */ sequence = protoInt64.zero; /** * identifies the port on the sending chain. * * @generated from field: string source_port = 2; */ sourcePort = ""; /** * identifies the channel end on the sending chain. * * @generated from field: string source_channel = 3; */ sourceChannel = ""; /** * identifies the port on the receiving chain. * * @generated from field: string destination_port = 4; */ destinationPort = ""; /** * identifies the channel end on the receiving chain. * * @generated from field: string destination_channel = 5; */ destinationChannel = ""; /** * actual opaque bytes transferred directly to the application module * * @generated from field: bytes data = 6; */ data = new Uint8Array(0); /** * block height after which the packet times out * * @generated from field: ibc.core.client.v1.Height timeout_height = 7; */ timeoutHeight?: Height; /** * block timestamp (in nanoseconds) after which the packet times out * * @generated from field: uint64 timeout_timestamp = 8; */ timeoutTimestamp = protoInt64.zero; constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ibc.core.channel.v1.Packet"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sequence", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "source_port", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "source_channel", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 4, name: "destination_port", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 5, name: "destination_channel", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 6, name: "data", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, { no: 7, name: "timeout_height", kind: "message", T: Height }, { no: 8, name: "timeout_timestamp", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Packet { return new Packet().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): Packet { return new Packet().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): Packet { return new Packet().fromJsonString(jsonString, options); } static equals(a: Packet | PlainMessage | undefined, b: Packet | PlainMessage | undefined): boolean { return proto3.util.equals(Packet, a, b); } } /** * PacketState defines the generic type necessary to retrieve and store * packet commitments, acknowledgements, and receipts. * Caller is responsible for knowing the context necessary to interpret this * state as a commitment, acknowledgement, or a receipt. * * @generated from message ibc.core.channel.v1.PacketState */ export class PacketState extends Message { /** * channel port identifier. * * @generated from field: string port_id = 1; */ portId = ""; /** * channel unique identifier. * * @generated from field: string channel_id = 2; */ channelId = ""; /** * packet sequence. * * @generated from field: uint64 sequence = 3; */ sequence = protoInt64.zero; /** * embedded data that represents packet state. * * @generated from field: bytes data = 4; */ data = new Uint8Array(0); constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ibc.core.channel.v1.PacketState"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "port_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "channel_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "sequence", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 4, name: "data", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PacketState { return new PacketState().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): PacketState { return new PacketState().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): PacketState { return new PacketState().fromJsonString(jsonString, options); } static equals(a: PacketState | PlainMessage | undefined, b: PacketState | PlainMessage | undefined): boolean { return proto3.util.equals(PacketState, a, b); } } /** * PacketId is an identifier for a unique Packet * Source chains refer to packets by source port/channel * Destination chains refer to packets by destination port/channel * * @generated from message ibc.core.channel.v1.PacketId */ export class PacketId extends Message { /** * channel port identifier * * @generated from field: string port_id = 1; */ portId = ""; /** * channel unique identifier * * @generated from field: string channel_id = 2; */ channelId = ""; /** * packet sequence * * @generated from field: uint64 sequence = 3; */ sequence = protoInt64.zero; constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ibc.core.channel.v1.PacketId"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "port_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "channel_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "sequence", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PacketId { return new PacketId().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): PacketId { return new PacketId().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): PacketId { return new PacketId().fromJsonString(jsonString, options); } static equals(a: PacketId | PlainMessage | undefined, b: PacketId | PlainMessage | undefined): boolean { return proto3.util.equals(PacketId, a, b); } } /** * Acknowledgement is the recommended acknowledgement format to be used by * app-specific protocols. * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental * conflicts with other protobuf message formats used for acknowledgements. * The first byte of any message with this format will be the non-ASCII values * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope * * @generated from message ibc.core.channel.v1.Acknowledgement */ export class Acknowledgement extends Message { /** * response contains either a result or an error and must be non-empty * * @generated from oneof ibc.core.channel.v1.Acknowledgement.response */ response: { /** * @generated from field: bytes result = 21; */ value: Uint8Array; case: "result"; } | { /** * @generated from field: string error = 22; */ value: string; case: "error"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ibc.core.channel.v1.Acknowledgement"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 21, name: "result", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "response" }, { no: 22, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "response" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Acknowledgement { return new Acknowledgement().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): Acknowledgement { return new Acknowledgement().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): Acknowledgement { return new Acknowledgement().fromJsonString(jsonString, options); } static equals(a: Acknowledgement | PlainMessage | undefined, b: Acknowledgement | PlainMessage | undefined): boolean { return proto3.util.equals(Acknowledgement, a, b); } } /** * Timeout defines an execution deadline structure for 04-channel handlers. * This includes packet lifecycle handlers as well as the upgrade handshake handlers. * A valid Timeout contains either one or both of a timestamp and block height (sequence). * * @generated from message ibc.core.channel.v1.Timeout */ export class Timeout extends Message { /** * block height after which the packet or upgrade times out * * @generated from field: ibc.core.client.v1.Height height = 1; */ height?: Height; /** * block timestamp (in nanoseconds) after which the packet or upgrade times out * * @generated from field: uint64 timestamp = 2; */ timestamp = protoInt64.zero; constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ibc.core.channel.v1.Timeout"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "height", kind: "message", T: Height }, { no: 2, name: "timestamp", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Timeout { return new Timeout().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): Timeout { return new Timeout().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): Timeout { return new Timeout().fromJsonString(jsonString, options); } static equals(a: Timeout | PlainMessage | undefined, b: Timeout | PlainMessage | undefined): boolean { return proto3.util.equals(Timeout, a, b); } } /** * Params defines the set of IBC channel parameters. * * @generated from message ibc.core.channel.v1.Params */ export class Params extends Message { /** * the relative timeout after which channel upgrades will time out. * * @generated from field: ibc.core.channel.v1.Timeout upgrade_timeout = 1; */ upgradeTimeout?: Timeout; constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; static readonly typeName = "ibc.core.channel.v1.Params"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "upgrade_timeout", kind: "message", T: Timeout }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Params { return new Params().fromBinary(bytes, options); } static fromJson(jsonValue: JsonValue, options?: Partial): Params { return new Params().fromJson(jsonValue, options); } static fromJsonString(jsonString: string, options?: Partial): Params { return new Params().fromJsonString(jsonString, options); } static equals(a: Params | PlainMessage | undefined, b: Params | PlainMessage | undefined): boolean { return proto3.util.equals(Params, a, b); } }